From d411eeee46d8a69716d542b8779163605683f70d Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Tue, 16 Dec 2025 17:39:36 +0300 Subject: [PATCH] Minor changes --- .../Module/Private/InitialActions.ps1 | 3 +-- .../Module/Sophia.psm1 | 19 +++++++++---------- .../Module/Private/InitialActions.ps1 | 3 +-- .../Module/Sophia.psm1 | 1 - .../Module/Private/InitialActions.ps1 | 3 +-- .../Module/Sophia.psm1 | 1 - .../Module/Private/InitialActions.ps1 | 3 +-- .../Module/Sophia.psm1 | 19 +++++++++---------- .../Module/Private/InitialActions.ps1 | 3 +-- .../Module/Sophia.psm1 | 13 ++++++------- src/Sophia_Script_for_Windows_11/Sophia.ps1 | 2 +- .../Module/Private/InitialActions.ps1 | 3 +-- .../Module/Sophia.psm1 | 13 ++++++------- .../Module/Private/InitialActions.ps1 | 3 +-- .../Module/Sophia.psm1 | 13 ++++++------- .../Module/Private/InitialActions.ps1 | 3 +-- .../Module/Sophia.psm1 | 13 ++++++------- .../Module/Private/InitialActions.ps1 | 3 +-- .../Module/Sophia.psm1 | 13 ++++++------- 19 files changed, 58 insertions(+), 76 deletions(-) diff --git a/src/Sophia_Script_for_Windows_10/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_10/Module/Private/InitialActions.ps1 index ebf781e7..2ed3cd6d 100644 --- a/src/Sophia_Script_for_Windows_10/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_10/Module/Private/InitialActions.ps1 @@ -1160,8 +1160,7 @@ public extern static string BrandingFormatString(string sFormat); { # Get the name of a preset (e.g Sophia.ps1) regardless it was named Write-Information -MessageData "" -InformationAction Continue - $CurrentScriptName = Split-Path -Path $MyInvocation.PSCommandPath -Leaf - [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_ -match $CurrentScriptName} + [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {($_.Text -match "InitialActions") -and ($_.Text -notmatch "Get-PSCallStack")}).File Write-Verbose -Message ($Localization.CustomizationWarning -f $PresetName) -Verbose do diff --git a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 index ca785a81..591f4de2 100644 --- a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 @@ -333,7 +333,6 @@ function FeedbackFrequency # Remove all policies in order to make changes visible in UI Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Force -ErrorAction Ignore Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Type DELETE - Remove-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name PeriodInNanoSeconds -Force -ErrorAction Ignore switch ($PSCmdlet.ParameterSetName) @@ -888,19 +887,19 @@ function WindowsWelcomeExperience <# .SYNOPSIS - Getting tips, tricks, and suggestions as you use Windows + Getting tip and suggestions when I use Windows .PARAMETER Enable - Get tips, tricks, and suggestions as you use Windows + Get tip and suggestions when using Windows .PARAMETER Disable - Do not get tips, tricks, and suggestions as you use Windows + Do not get tip and suggestions when I use Windows .EXAMPLE - WindowsTips -Enable + WindowsTips -Disable .EXAMPLE - WindowsTips -Disable + WindowsTips -Enable .NOTES Current user @@ -930,14 +929,14 @@ function WindowsTips switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force - } "Disable" { New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 0 -Force } + "Enable" + { + New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force + } } } diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Private/InitialActions.ps1 index 6a985b10..b847433f 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Private/InitialActions.ps1 @@ -1112,8 +1112,7 @@ public extern static string BrandingFormatString(string sFormat); { # Get the name of a preset (e.g Sophia.ps1) regardless it was named Write-Information -MessageData "" -InformationAction Continue - $CurrentScriptName = Split-Path -Path $MyInvocation.PSCommandPath -Leaf - [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_ -match $CurrentScriptName} + [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {($_.Text -match "InitialActions") -and ($_.Text -notmatch "Get-PSCallStack")}).File Write-Verbose -Message ($Localization.CustomizationWarning -f $PresetName) -Verbose do diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 index 83683fb1..1304b544 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 @@ -317,7 +317,6 @@ function FeedbackFrequency # Remove all policies in order to make changes visible in UI Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Force -ErrorAction Ignore Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Type DELETE - Remove-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name PeriodInNanoSeconds -Force -ErrorAction Ignore switch ($PSCmdlet.ParameterSetName) diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Private/InitialActions.ps1 index aa72a7dc..f7d24749 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Private/InitialActions.ps1 @@ -1111,8 +1111,7 @@ public extern static string BrandingFormatString(string sFormat); { # Get the name of a preset (e.g Sophia.ps1) regardless it was named Write-Information -MessageData "" -InformationAction Continue - $CurrentScriptName = Split-Path -Path $MyInvocation.PSCommandPath -Leaf - [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_ -match $CurrentScriptName} + [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {($_.Text -match "InitialActions") -and ($_.Text -notmatch "Get-PSCallStack")}).File Write-Verbose -Message ($Localization.CustomizationWarning -f $PresetName) -Verbose do diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 index 559871a2..2ec64ca6 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 @@ -317,7 +317,6 @@ function FeedbackFrequency # Remove all policies in order to make changes visible in UI Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Force -ErrorAction Ignore Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Type DELETE - Remove-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name PeriodInNanoSeconds -Force -ErrorAction Ignore switch ($PSCmdlet.ParameterSetName) diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Private/InitialActions.ps1 index 1016d33d..4e020f57 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Private/InitialActions.ps1 @@ -1197,8 +1197,7 @@ public extern static string BrandingFormatString(string sFormat); { # Get the name of a preset (e.g Sophia.ps1) regardless it was named Write-Information -MessageData "" -InformationAction Continue - $CurrentScriptName = Split-Path -Path $MyInvocation.PSCommandPath -Leaf - [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_ -match $CurrentScriptName} + [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {($_.Text -match "InitialActions") -and ($_.Text -notmatch "Get-PSCallStack")}).File Write-Verbose -Message ($Localization.CustomizationWarning -f $PresetName) -Verbose do diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 index 58f83d25..06fb6f03 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 @@ -331,7 +331,6 @@ function FeedbackFrequency # Remove all policies in order to make changes visible in UI Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Force -ErrorAction Ignore Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Type DELETE - Remove-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name PeriodInNanoSeconds -Force -ErrorAction Ignore switch ($PSCmdlet.ParameterSetName) @@ -886,19 +885,19 @@ function WindowsWelcomeExperience <# .SYNOPSIS - Getting tips, tricks, and suggestions as you use Windows + Getting tip and suggestions when I use Windows .PARAMETER Enable - Get tips, tricks, and suggestions as you use Windows + Get tip and suggestions when using Windows .PARAMETER Disable - Do not get tips, tricks, and suggestions as you use Windows + Do not get tip and suggestions when I use Windows .EXAMPLE - WindowsTips -Enable + WindowsTips -Disable .EXAMPLE - WindowsTips -Disable + WindowsTips -Enable .NOTES Current user @@ -928,14 +927,14 @@ function WindowsTips switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force - } "Disable" { New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 0 -Force } + "Enable" + { + New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force + } } } diff --git a/src/Sophia_Script_for_Windows_11/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_11/Module/Private/InitialActions.ps1 index ddfc88a7..8f891ddd 100644 --- a/src/Sophia_Script_for_Windows_11/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_11/Module/Private/InitialActions.ps1 @@ -1133,8 +1133,7 @@ public extern static string BrandingFormatString(string sFormat); { # Get the name of a preset (e.g Sophia.ps1) regardless it was named Write-Information -MessageData "" -InformationAction Continue - $CurrentScriptName = Split-Path -Path $MyInvocation.PSCommandPath -Leaf - [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_ -match $CurrentScriptName} + [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {($_.Text -match "InitialActions") -and ($_.Text -notmatch "Get-PSCallStack")}).File Write-Verbose -Message ($Localization.CustomizationWarning -f $PresetName) -Verbose do diff --git a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 index 82487cf9..701fedb1 100644 --- a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 @@ -331,7 +331,6 @@ function FeedbackFrequency # Remove all policies in order to make changes visible in UI Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Force -ErrorAction Ignore Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Type DELETE - Remove-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name PeriodInNanoSeconds -Force -ErrorAction Ignore switch ($PSCmdlet.ParameterSetName) @@ -901,10 +900,10 @@ function WindowsWelcomeExperience Do not get tip and suggestions when I use Windows .EXAMPLE - WindowsTips -Enable + WindowsTips -Disable .EXAMPLE - WindowsTips -Disable + WindowsTips -Enable .NOTES Current user @@ -934,14 +933,14 @@ function WindowsTips switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force - } "Disable" { New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 0 -Force } + "Enable" + { + New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force + } } } diff --git a/src/Sophia_Script_for_Windows_11/Sophia.ps1 b/src/Sophia_Script_for_Windows_11/Sophia.ps1 index 9a2914e8..10fc4832 100644 --- a/src/Sophia_Script_for_Windows_11/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_11/Sophia.ps1 @@ -85,7 +85,7 @@ if ($Global:Failed -eq 1) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Preset configuration starts here # -# Настройка пресет-файла начинается здесь # +# Настройка пресет-файла начинается здесь # ### # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #region Protection diff --git a/src/Sophia_Script_for_Windows_11_ARM/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_11_ARM/Module/Private/InitialActions.ps1 index 884ea5a1..7e3d5a17 100644 --- a/src/Sophia_Script_for_Windows_11_ARM/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_11_ARM/Module/Private/InitialActions.ps1 @@ -1133,8 +1133,7 @@ public extern static string BrandingFormatString(string sFormat); { # Get the name of a preset (e.g Sophia.ps1) regardless it was named Write-Information -MessageData "" -InformationAction Continue - $CurrentScriptName = Split-Path -Path $MyInvocation.PSCommandPath -Leaf - [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_ -match $CurrentScriptName} + [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {($_.Text -match "InitialActions") -and ($_.Text -notmatch "Get-PSCallStack")}).File Write-Verbose -Message ($Localization.CustomizationWarning -f $PresetName) -Verbose do diff --git a/src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1 index 2270dd32..af99bdef 100644 --- a/src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1 @@ -334,7 +334,6 @@ function FeedbackFrequency # Remove all policies in order to make changes visible in UI Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Force -ErrorAction Ignore Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Type DELETE - Remove-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name PeriodInNanoSeconds -Force -ErrorAction Ignore switch ($PSCmdlet.ParameterSetName) @@ -904,10 +903,10 @@ function WindowsWelcomeExperience Do not get tip and suggestions when I use Windows .EXAMPLE - WindowsTips -Enable + WindowsTips -Disable .EXAMPLE - WindowsTips -Disable + WindowsTips -Enable .NOTES Current user @@ -937,14 +936,14 @@ function WindowsTips switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force - } "Disable" { New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 0 -Force } + "Enable" + { + New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force + } } } diff --git a/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Private/InitialActions.ps1 index d909fdb4..fca07df1 100644 --- a/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Private/InitialActions.ps1 @@ -1170,8 +1170,7 @@ public extern static string BrandingFormatString(string sFormat); { # Get the name of a preset (e.g Sophia.ps1) regardless it was named Write-Information -MessageData "" -InformationAction Continue - $CurrentScriptName = Split-Path -Path $MyInvocation.PSCommandPath -Leaf - [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_ -match $CurrentScriptName} + [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {($_.Text -match "InitialActions") -and ($_.Text -notmatch "Get-PSCallStack")}).File Write-Verbose -Message ($Localization.CustomizationWarning -f $PresetName) -Verbose do diff --git a/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1 index 05b3a474..85348f7d 100644 --- a/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1 @@ -334,7 +334,6 @@ function FeedbackFrequency # Remove all policies in order to make changes visible in UI Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Force -ErrorAction Ignore Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Type DELETE - Remove-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name PeriodInNanoSeconds -Force -ErrorAction Ignore switch ($PSCmdlet.ParameterSetName) @@ -904,10 +903,10 @@ function WindowsWelcomeExperience Do not get tip and suggestions when I use Windows .EXAMPLE - WindowsTips -Enable + WindowsTips -Disable .EXAMPLE - WindowsTips -Disable + WindowsTips -Enable .NOTES Current user @@ -937,14 +936,14 @@ function WindowsTips switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force - } "Disable" { New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 0 -Force } + "Enable" + { + New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force + } } } diff --git a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Private/InitialActions.ps1 index 72c75b7e..257adc8b 100644 --- a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Private/InitialActions.ps1 @@ -1112,8 +1112,7 @@ public extern static string BrandingFormatString(string sFormat); { # Get the name of a preset (e.g Sophia.ps1) regardless it was named Write-Information -MessageData "" -InformationAction Continue - $CurrentScriptName = Split-Path -Path $MyInvocation.PSCommandPath -Leaf - [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_ -match $CurrentScriptName} + [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {($_.Text -match "InitialActions") -and ($_.Text -notmatch "Get-PSCallStack")}).File Write-Verbose -Message ($Localization.CustomizationWarning -f $PresetName) -Verbose do diff --git a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 index c33d7529..91c9e654 100644 --- a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 @@ -321,7 +321,6 @@ function FeedbackFrequency # Remove all policies in order to make changes visible in UI Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Force -ErrorAction Ignore Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Type DELETE - Remove-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name PeriodInNanoSeconds -Force -ErrorAction Ignore switch ($PSCmdlet.ParameterSetName) @@ -891,10 +890,10 @@ function WindowsWelcomeExperience Do not get tip and suggestions when I use Windows .EXAMPLE - WindowsTips -Enable + WindowsTips -Disable .EXAMPLE - WindowsTips -Disable + WindowsTips -Enable .NOTES Current user @@ -924,14 +923,14 @@ function WindowsTips switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force - } "Disable" { New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 0 -Force } + "Enable" + { + New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force + } } } diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Private/InitialActions.ps1 index 25bdf733..6d994c28 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Private/InitialActions.ps1 @@ -1170,8 +1170,7 @@ public extern static string BrandingFormatString(string sFormat); { # Get the name of a preset (e.g Sophia.ps1) regardless it was named Write-Information -MessageData "" -InformationAction Continue - $CurrentScriptName = Split-Path -Path $MyInvocation.PSCommandPath -Leaf - [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_ -match $CurrentScriptName} + [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {($_.Text -match "InitialActions") -and ($_.Text -notmatch "Get-PSCallStack")}).File Write-Verbose -Message ($Localization.CustomizationWarning -f $PresetName) -Verbose do diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 index 9e5c3a1e..f424742a 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 @@ -331,7 +331,6 @@ function FeedbackFrequency # Remove all policies in order to make changes visible in UI Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Force -ErrorAction Ignore Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Type DELETE - Remove-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name PeriodInNanoSeconds -Force -ErrorAction Ignore switch ($PSCmdlet.ParameterSetName) @@ -901,10 +900,10 @@ function WindowsWelcomeExperience Do not get tip and suggestions when I use Windows .EXAMPLE - WindowsTips -Enable + WindowsTips -Disable .EXAMPLE - WindowsTips -Disable + WindowsTips -Enable .NOTES Current user @@ -934,14 +933,14 @@ function WindowsTips switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force - } "Disable" { New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 0 -Force } + "Enable" + { + New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force + } } }