Browse Source

Fixed typos

master
Dmitry Nefedov 2 weeks ago
parent
commit
1194bd2569
  1. 30
      src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
  2. 4
      src/Sophia_Script_for_Windows_10/Sophia.ps1
  3. 10
      src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1
  4. 4
      src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1
  5. 10
      src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1
  6. 4
      src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1
  7. 30
      src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
  8. 4
      src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1
  9. 30
      src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
  10. 4
      src/Sophia_Script_for_Windows_11/Sophia.ps1
  11. 30
      src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1
  12. 4
      src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1

30
src/Sophia_Script_for_Windows_10/Module/Sophia.psm1

@ -62,7 +62,7 @@ function InitialActions
# https://github.com/PowerShell/PowerShell/issues/2138
$Script:ProgressPreference = "SilentlyContinue"
# Extract strings from %SystemRoot%\System32\shell32.dll using its' number
# Extract strings from %SystemRoot%\System32\shell32.dll using its number
# https://github.com/SamuelArnold/StarKill3r/blob/master/Star%20Killer/Star%20Killer/bin/Debug/Scripts/SANS-SEC505-master/scripts/Day1-PowerShell/Expand-IndirectString.ps1
# [WinAPI.GetStrings]::GetIndirectString("@%SystemRoot%\system32\schedsvc.dll,-100")
@ -3822,12 +3822,13 @@ function UnpinTaskbarShortcuts
Store
{
# Start-Job is used due to that the calling this function before UninstallUWPApps breaks the retrieval of the localized UWP apps packages names
if ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {$_.Path -eq "Microsoft.WindowsStore_8wekyb3d8bbwe!App"})
if ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"})
{
Start-Job -ScriptBlock {
$Apps = (New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items()
# Extract the localized "Unpin from taskbar" string from shell32.dll
($Apps | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()}
((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {
$_.Name -eq "Microsoft Store"
}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} | Receive-Job -Wait -AutoRemoveJob
}
}
@ -5028,7 +5029,7 @@ function OneDrive
Stop-Process -Name OneDrive, OneDriveSetup, FileCoAuth -Force -ErrorAction Ignore
# Getting link to the OneDriveSetup.exe and its' argument(s)
# Getting link to the OneDriveSetup.exe and its argument(s)
[string[]]$OneDriveSetup = ($UninstallString -replace("\s*/", ",/")).Split(",").Trim()
if ($OneDriveSetup.Count -eq 2)
{
@ -5109,7 +5110,7 @@ public static bool MarkFileDelete (string sourcefile)
# Do not restart the File Explorer process automatically if it stops in order to unload libraries
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoRestartShell -PropertyType DWord -Value 0 -Force
# Kill all explorer instances in case launch folder windows in a separate process enabled
# Kill all explorer instances in case "launch folder windows in a separate process" enabled
Get-Process -Name explorer | Stop-Process -Force
Start-Sleep -Seconds 3
# Restart the File Explorer process automatically if it stops in order to unload libraries
@ -10463,7 +10464,7 @@ function RKNBypass
Desktop shortcut creation upon Microsoft Edge update
.PARAMETER Channels
List Microsoft Edge channels to prevent desktop shortcut creation upon its' update
List Microsoft Edge channels to prevent desktop shortcut creation upon its update
.PARAMETER Disable
Do not prevent desktop shortcut creation upon Microsoft Edge update
@ -11576,7 +11577,7 @@ function UninstallUWPApps
$Window.Close() | Out-Null
# If Xbox Game Bar is selected to uninstall stop its' processes
# If Xbox Game Bar is selected to uninstall stop its processes
if ($PackagesToRemove -match "Microsoft.XboxGamingOverlay")
{
Get-Process -Name GameBar, GameBarFTServer -ErrorAction Ignore | Stop-Process -Force
@ -15432,7 +15433,7 @@ public static void PostMessage()
Set-WinHomeLocation -GeoId $Script:Region
}
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its' own database
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its own database
if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt"))
{
if (Test-Path -Path "$env:TEMP\Computer.txt")
@ -15461,7 +15462,7 @@ public static void PostMessage()
# https://github.com/PowerShell/PowerShell/issues/21070
Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Recurse -Force -ErrorAction Ignore
# Kill all explorer instances in case launch folder windows in a separate process enabled
# Kill all explorer instances in case "launch folder windows in a separate process" enabled
Get-Process -Name explorer | Stop-Process -Force
Start-Sleep -Seconds 3
@ -15477,7 +15478,7 @@ public static void PostMessage()
# Check whether any of scheduled tasks were created. Unless open Task Scheduler
if ($Script:ScheduledTasks)
{
# Find and close taskschd.msc by its' argument
# Find and close taskschd.msc by its argument
$taskschd_Process_ID = (Get-CimInstance -ClassName CIM_Process | Where-Object -FilterScript {$_.Name -eq "mmc.exe"} | Where-Object -FilterScript {
$_.CommandLine -match "taskschd.msc"
}).Handle
@ -15596,13 +15597,6 @@ public static void PostMessage()
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage)
#endregion Toast notifications
# Check for UWP apps updates
Write-Information -MessageData "" -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose
Get-CimInstance -Namespace root/CIMV2/mdm/dmmap -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 | Invoke-CimMethod -MethodName UpdateScanMethod
}
#endregion Post Actions

4
src/Sophia_Script_for_Windows_10/Sophia.ps1

@ -12,7 +12,7 @@
.DESCRIPTION
Place the "#" char before function if you don't want to run it
Remove the "#" char before function if you want to run it
Every tweak in the preset file has its' corresponding function to restore the default settings
Every tweak in the preset file has its corresponding function to restore the default settings
.EXAMPLE Run the whole script
.\Sophia.ps1
@ -1024,7 +1024,7 @@ RKNBypass -Enable
# https://antizapret.prostovpn.org
# RKNBypass -Disable
# List Microsoft Edge channels to prevent desktop shortcut creation upon its' update
# List Microsoft Edge channels to prevent desktop shortcut creation upon its update
# Перечислите каналы Microsoft Edge для предотвращения создания ярлыков на рабочем столе после его обновления
PreventEdgeShortcutCreation -Channels Stable, Beta, Dev, Canary

10
src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1

@ -62,7 +62,7 @@ function InitialActions
# https://github.com/PowerShell/PowerShell/issues/2138
$Script:ProgressPreference = "SilentlyContinue"
# Extract strings from %SystemRoot%\System32\shell32.dll using its' number
# Extract strings from %SystemRoot%\System32\shell32.dll using its number
# https://github.com/SamuelArnold/StarKill3r/blob/master/Star%20Killer/Star%20Killer/bin/Debug/Scripts/SANS-SEC505-master/scripts/Day1-PowerShell/Expand-IndirectString.ps1
# [WinAPI.GetStrings]::GetIndirectString("@%SystemRoot%\system32\schedsvc.dll,-100")
@ -8775,7 +8775,7 @@ function RKNBypass
Desktop shortcut creation upon Microsoft Edge update
.PARAMETER Channels
List Microsoft Edge channels to prevent desktop shortcut creation upon its' update
List Microsoft Edge channels to prevent desktop shortcut creation upon its update
.PARAMETER Disable
Do not prevent desktop shortcut creation upon Microsoft Edge update
@ -11977,7 +11977,7 @@ public static void PostMessage()
Set-WinHomeLocation -GeoId $Script:Region
}
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its' own database
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its own database
if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt"))
{
if (Test-Path -Path "$env:TEMP\Computer.txt")
@ -11996,7 +11996,7 @@ public static void PostMessage()
# https://github.com/PowerShell/PowerShell/issues/21070
Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Recurse -Force -ErrorAction Ignore
# Kill all explorer instances in case launch folder windows in a separate process enabled
# Kill all explorer instances in case "launch folder windows in a separate process" enabled
Get-Process -Name explorer | Stop-Process -Force
Start-Sleep -Seconds 3
@ -12012,7 +12012,7 @@ public static void PostMessage()
# Check whether any of scheduled tasks were created. Unless open Task Scheduler
if ($Script:ScheduledTasks)
{
# Find and close taskschd.msc by its' argument
# Find and close taskschd.msc by its argument
$taskschd_Process_ID = (Get-CimInstance -ClassName CIM_Process | Where-Object -FilterScript {$_.Name -eq "mmc.exe"} | Where-Object -FilterScript {
$_.CommandLine -match "taskschd.msc"
}).Handle

4
src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1

@ -12,7 +12,7 @@
.DESCRIPTION
Place the "#" char before function if you don't want to run it
Remove the "#" char before function if you want to run it
Every tweak in the preset file has its' corresponding function to restore the default settings
Every tweak in the preset file has its corresponding function to restore the default settings
.EXAMPLE Run the whole script
.\Sophia.ps1
@ -805,7 +805,7 @@ RKNBypass -Enable
# https://antizapret.prostovpn.org
# RKNBypass -Disable
# List Microsoft Edge channels to prevent desktop shortcut creation upon its' update
# List Microsoft Edge channels to prevent desktop shortcut creation upon its update
# Перечислите каналы Microsoft Edge для предотвращения создания ярлыков на рабочем столе после его обновления
PreventEdgeShortcutCreation -Channels Stable, Beta, Dev, Canary

10
src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1

@ -62,7 +62,7 @@ function InitialActions
# https://github.com/PowerShell/PowerShell/issues/2138
$Script:ProgressPreference = "SilentlyContinue"
# Extract strings from %SystemRoot%\System32\shell32.dll using its' number
# Extract strings from %SystemRoot%\System32\shell32.dll using its number
# https://github.com/SamuelArnold/StarKill3r/blob/master/Star%20Killer/Star%20Killer/bin/Debug/Scripts/SANS-SEC505-master/scripts/Day1-PowerShell/Expand-IndirectString.ps1
# [WinAPI.GetStrings]::GetIndirectString("@%SystemRoot%\system32\schedsvc.dll,-100")
@ -9402,7 +9402,7 @@ function RKNBypass
Desktop shortcut creation upon Microsoft Edge update
.PARAMETER Channels
List Microsoft Edge channels to prevent desktop shortcut creation upon its' update
List Microsoft Edge channels to prevent desktop shortcut creation upon its update
.PARAMETER Disable
Do not prevent desktop shortcut creation upon Microsoft Edge update
@ -13168,7 +13168,7 @@ public static void PostMessage()
Set-WinHomeLocation -GeoId $Script:Region
}
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its' own database
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its own database
if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt"))
{
if (Test-Path -Path "$env:TEMP\Computer.txt")
@ -13187,7 +13187,7 @@ public static void PostMessage()
# https://github.com/PowerShell/PowerShell/issues/21070
Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Recurse -Force -ErrorAction Ignore
# Kill all explorer instances in case launch folder windows in a separate process enabled
# Kill all explorer instances in case "launch folder windows in a separate process" enabled
Get-Process -Name explorer | Stop-Process -Force
Start-Sleep -Seconds 3
@ -13203,7 +13203,7 @@ public static void PostMessage()
# Check whether any of scheduled tasks were created. Unless open Task Scheduler
if ($Script:ScheduledTasks)
{
# Find and close taskschd.msc by its' argument
# Find and close taskschd.msc by its argument
$taskschd_Process_ID = (Get-CimInstance -ClassName CIM_Process | Where-Object -FilterScript {$_.Name -eq "mmc.exe"} | Where-Object -FilterScript {
$_.CommandLine -match "taskschd.msc"
}).Handle

4
src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1

@ -12,7 +12,7 @@
.DESCRIPTION
Place the "#" char before function if you don't want to run it
Remove the "#" char before function if you want to run it
Every tweak in the preset file has its' corresponding function to restore the default settings
Every tweak in the preset file has its corresponding function to restore the default settings
.EXAMPLE Run the whole script
.\Sophia.ps1
@ -903,7 +903,7 @@ RKNBypass -Enable
# https://antizapret.prostovpn.org
# RKNBypass -Disable
# List Microsoft Edge channels to prevent desktop shortcut creation upon its' update
# List Microsoft Edge channels to prevent desktop shortcut creation upon its update
# Перечислите каналы Microsoft Edge для предотвращения создания ярлыков на рабочем столе после его обновления
PreventEdgeShortcutCreation -Channels Stable, Beta, Dev, Canary

30
src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1

@ -58,7 +58,7 @@ function InitialActions
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Extract strings from %SystemRoot%\System32\shell32.dll using its' number
# Extract strings from %SystemRoot%\System32\shell32.dll using its number
# https://github.com/SamuelArnold/StarKill3r/blob/master/Star%20Killer/Star%20Killer/bin/Debug/Scripts/SANS-SEC505-master/scripts/Day1-PowerShell/Expand-IndirectString.ps1
# [WinAPI.GetStrings]::GetIndirectString("@%SystemRoot%\system32\schedsvc.dll,-100")
@ -3828,12 +3828,13 @@ function UnpinTaskbarShortcuts
Store
{
# Start-Job is used due to that the calling this function before UninstallUWPApps breaks the retrieval of the localized UWP apps packages names
if ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {$_.Path -eq "Microsoft.WindowsStore_8wekyb3d8bbwe!App"})
if ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"})
{
Start-Job -ScriptBlock {
$Apps = (New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items()
# Extract the localized "Unpin from taskbar" string from shell32.dll
($Apps | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()}
((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {
$_.Name -eq "Microsoft Store"
}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} | Receive-Job -Wait -AutoRemoveJob
}
}
@ -5034,7 +5035,7 @@ function OneDrive
Stop-Process -Name OneDrive, OneDriveSetup, FileCoAuth -Force -ErrorAction Ignore
# Getting link to the OneDriveSetup.exe and its' argument(s)
# Getting link to the OneDriveSetup.exe and its argument(s)
[string[]]$OneDriveSetup = ($UninstallString -replace("\s*/", ",/")).Split(",").Trim()
if ($OneDriveSetup.Count -eq 2)
{
@ -5115,7 +5116,7 @@ public static bool MarkFileDelete (string sourcefile)
# Do not restart the File Explorer process automatically if it stops in order to unload libraries
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoRestartShell -PropertyType DWord -Value 0 -Force
# Kill all explorer instances in case launch folder windows in a separate process enabled
# Kill all explorer instances in case "launch folder windows in a separate process" enabled
Get-Process -Name explorer | Stop-Process -Force
Start-Sleep -Seconds 3
# Restart the File Explorer process automatically if it stops in order to unload libraries
@ -10469,7 +10470,7 @@ function RKNBypass
Desktop shortcut creation upon Microsoft Edge update
.PARAMETER Channels
List Microsoft Edge channels to prevent desktop shortcut creation upon its' update
List Microsoft Edge channels to prevent desktop shortcut creation upon its update
.PARAMETER Disable
Do not prevent desktop shortcut creation upon Microsoft Edge update
@ -11592,7 +11593,7 @@ function UninstallUWPApps
$Window.Close() | Out-Null
# If Xbox Game Bar is selected to uninstall stop its' processes
# If Xbox Game Bar is selected to uninstall stop its processes
if ($PackagesToRemove -match "Microsoft.XboxGamingOverlay")
{
Get-Process -Name GameBar, GameBarFTServer -ErrorAction Ignore | Stop-Process -Force
@ -15458,7 +15459,7 @@ public static void PostMessage()
Set-WinHomeLocation -GeoId $Script:Region
}
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its' own database
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its own database
if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt"))
{
if (Test-Path -Path "$env:TEMP\Computer.txt")
@ -15487,7 +15488,7 @@ public static void PostMessage()
# https://github.com/PowerShell/PowerShell/issues/21070
Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Recurse -Force -ErrorAction Ignore
# Kill all explorer instances in case launch folder windows in a separate process enabled
# Kill all explorer instances in case "launch folder windows in a separate process" enabled
Get-Process -Name explorer | Stop-Process -Force
Start-Sleep -Seconds 3
@ -15503,7 +15504,7 @@ public static void PostMessage()
# Check whether any of scheduled tasks were created. Unless open Task Scheduler
if ($Script:ScheduledTasks)
{
# Find and close taskschd.msc by its' argument
# Find and close taskschd.msc by its argument
$taskschd_Process_ID = (Get-CimInstance -ClassName CIM_Process | Where-Object -FilterScript {$_.Name -eq "mmc.exe"} | Where-Object -FilterScript {
$_.CommandLine -match "taskschd.msc"
}).Handle
@ -15622,13 +15623,6 @@ public static void PostMessage()
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage)
#endregion Toast notifications
# Check for UWP apps updates
Write-Information -MessageData "" -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose
Get-CimInstance -Namespace root/CIMV2/mdm/dmmap -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 | Invoke-CimMethod -MethodName UpdateScanMethod
}
#endregion Post Actions

4
src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1

@ -12,7 +12,7 @@
.DESCRIPTION
Place the "#" char before function if you don't want to run it
Remove the "#" char before function if you want to run it
Every tweak in the preset file has its' corresponding function to restore the default settings
Every tweak in the preset file has its corresponding function to restore the default settings
.EXAMPLE Run the whole script
.\Sophia.ps1
@ -1033,7 +1033,7 @@ RKNBypass -Enable
# https://antizapret.prostovpn.org
# RKNBypass -Disable
# List Microsoft Edge channels to prevent desktop shortcut creation upon its' update
# List Microsoft Edge channels to prevent desktop shortcut creation upon its update
# Перечислите каналы Microsoft Edge для предотвращения создания ярлыков на рабочем столе после его обновления
PreventEdgeShortcutCreation -Channels Stable, Beta, Dev, Canary

30
src/Sophia_Script_for_Windows_11/Module/Sophia.psm1

@ -61,7 +61,7 @@ function InitialActions
# https://github.com/PowerShell/PowerShell/issues/2138
$Script:ProgressPreference = "SilentlyContinue"
# Extract strings from %SystemRoot%\System32\shell32.dll using its' number
# Extract strings from %SystemRoot%\System32\shell32.dll using its number
# https://github.com/SamuelArnold/StarKill3r/blob/master/Star%20Killer/Star%20Killer/bin/Debug/Scripts/SANS-SEC505-master/scripts/Day1-PowerShell/Expand-IndirectString.ps1
# [WinAPI.GetStrings]::GetIndirectString("@%SystemRoot%\system32\schedsvc.dll,-100")
@ -3563,12 +3563,13 @@ function UnpinTaskbarShortcuts
Store
{
# Start-Job is used due to that the calling this function before UninstallUWPApps breaks the retrieval of the localized UWP apps packages names
if ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {$_.Path -eq "Microsoft.WindowsStore_8wekyb3d8bbwe!App"})
if ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"})
{
Start-Job -ScriptBlock {
$Apps = (New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items()
# Extract the localized "Unpin from taskbar" string from shell32.dll
($Apps | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()}
((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {
$_.Name -eq "Microsoft Store"
}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} | Receive-Job -Wait -AutoRemoveJob
}
}
@ -4629,7 +4630,7 @@ function OneDrive
Stop-Process -Name OneDrive, OneDriveSetup, FileCoAuth -Force -ErrorAction Ignore
# Getting link to the OneDriveSetup.exe and its' argument(s)
# Getting link to the OneDriveSetup.exe and its argument(s)
[string[]]$OneDriveSetup = ($UninstallString -replace("\s*/", ",/")).Split(",").Trim()
if ($OneDriveSetup.Count -eq 2)
{
@ -4710,7 +4711,7 @@ public static bool MarkFileDelete (string sourcefile)
# Do not restart the File Explorer process automatically if it stops in order to unload libraries
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoRestartShell -PropertyType DWord -Value 0 -Force
# Kill all explorer instances in case launch folder windows in a separate process enabled
# Kill all explorer instances in case "launch folder windows in a separate process" enabled
Get-Process -Name explorer | Stop-Process -Force
Start-Sleep -Seconds 3
# Restart the File Explorer process automatically if it stops in order to unload libraries
@ -10171,7 +10172,7 @@ function Install-WSA
Desktop shortcut creation upon Microsoft Edge update
.PARAMETER Channels
List Microsoft Edge channels to prevent desktop shortcut creation upon its' update
List Microsoft Edge channels to prevent desktop shortcut creation upon its update
.PARAMETER Disable
Do not prevent desktop shortcut creation upon Microsoft Edge update
@ -11008,7 +11009,7 @@ function UninstallUWPApps
$Window.Close() | Out-Null
# If Xbox Game Bar is selected to uninstall stop its' processes
# If Xbox Game Bar is selected to uninstall stop its processes
if ($PackagesToRemove -match "Microsoft.XboxGamingOverlay")
{
Get-Process -Name GameBar, GameBarFTServer -ErrorAction Ignore | Stop-Process -Force
@ -14706,7 +14707,7 @@ public static void PostMessage()
Set-WinHomeLocation -GeoId $Script:Region
}
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its' own database
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its own database
if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt"))
{
if (Test-Path -Path "$env:TEMP\Computer.txt")
@ -14725,7 +14726,7 @@ public static void PostMessage()
# https://github.com/PowerShell/PowerShell/issues/21070
Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Recurse -Force -ErrorAction Ignore
# Kill all explorer instances in case launch folder windows in a separate process enabled
# Kill all explorer instances in case "launch folder windows in a separate process" enabled
Get-Process -Name explorer | Stop-Process -Force
Start-Sleep -Seconds 3
@ -14741,7 +14742,7 @@ public static void PostMessage()
# Check whether any of scheduled tasks were created. Unless open Task Scheduler
if ($Script:ScheduledTasks)
{
# Find and close taskschd.msc by its' argument
# Find and close taskschd.msc by its argument
$taskschd_Process_ID = (Get-CimInstance -ClassName CIM_Process | Where-Object -FilterScript {$_.Name -eq "mmc.exe"} | Where-Object -FilterScript {
$_.CommandLine -match "taskschd.msc"
}).Handle
@ -14860,13 +14861,6 @@ public static void PostMessage()
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage)
#endregion Toast notifications
# Check for UWP apps updates
Write-Information -MessageData "" -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose
Get-CimInstance -Namespace root/CIMV2/mdm/dmmap -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 | Invoke-CimMethod -MethodName UpdateScanMethod
}
#endregion Post Actions

4
src/Sophia_Script_for_Windows_11/Sophia.ps1

@ -12,7 +12,7 @@
.DESCRIPTION
Place the "#" char before function if you don't want to run it
Remove the "#" char before function if you want to run it
Every tweak in the preset file has its' corresponding function to restore the default settings
Every tweak in the preset file has its corresponding function to restore the default settings
.EXAMPLE Run the whole script
.\Sophia.ps1
@ -1000,7 +1000,7 @@ RKNBypass -Enable
# Включить все необходимые зависимости (может потребоваться перезагрузка) и открыть страницу WSA в Microsoft Store, чтобы вручную установить Windows Subsystem for Android™ with Amazon Appstore
# Install-WSA
# List Microsoft Edge channels to prevent desktop shortcut creation upon its' update
# List Microsoft Edge channels to prevent desktop shortcut creation upon its update
# Перечислите каналы Microsoft Edge для предотвращения создания ярлыков на рабочем столе после его обновления
PreventEdgeShortcutCreation -Channels Stable, Beta, Dev, Canary

30
src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

@ -57,7 +57,7 @@ function InitialActions
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Extract strings from %SystemRoot%\System32\shell32.dll using its' number
# Extract strings from %SystemRoot%\System32\shell32.dll using its number
# https://github.com/SamuelArnold/StarKill3r/blob/master/Star%20Killer/Star%20Killer/bin/Debug/Scripts/SANS-SEC505-master/scripts/Day1-PowerShell/Expand-IndirectString.ps1
# [WinAPI.GetStrings]::GetIndirectString("@%SystemRoot%\system32\schedsvc.dll,-100")
@ -3566,12 +3566,13 @@ function UnpinTaskbarShortcuts
Store
{
# Start-Job is used due to that the calling this function before UninstallUWPApps breaks the retrieval of the localized UWP apps packages names
if ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {$_.Path -eq "Microsoft.WindowsStore_8wekyb3d8bbwe!App"})
if ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"})
{
Start-Job -ScriptBlock {
$Apps = (New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items()
# Extract the localized "Unpin from taskbar" string from shell32.dll
($Apps | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()}
((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {
$_.Name -eq "Microsoft Store"
}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} | Receive-Job -Wait -AutoRemoveJob
}
}
@ -4632,7 +4633,7 @@ function OneDrive
Stop-Process -Name OneDrive, OneDriveSetup, FileCoAuth -Force -ErrorAction Ignore
# Getting link to the OneDriveSetup.exe and its' argument(s)
# Getting link to the OneDriveSetup.exe and its argument(s)
[string[]]$OneDriveSetup = ($UninstallString -replace("\s*/", ",/")).Split(",").Trim()
if ($OneDriveSetup.Count -eq 2)
{
@ -4713,7 +4714,7 @@ public static bool MarkFileDelete (string sourcefile)
# Do not restart the File Explorer process automatically if it stops in order to unload libraries
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoRestartShell -PropertyType DWord -Value 0 -Force
# Kill all explorer instances in case launch folder windows in a separate process enabled
# Kill all explorer instances in case "launch folder windows in a separate process" enabled
Get-Process -Name explorer | Stop-Process -Force
Start-Sleep -Seconds 3
# Restart the File Explorer process automatically if it stops in order to unload libraries
@ -10174,7 +10175,7 @@ function Install-WSA
Desktop shortcut creation upon Microsoft Edge update
.PARAMETER Channels
List Microsoft Edge channels to prevent desktop shortcut creation upon its' update
List Microsoft Edge channels to prevent desktop shortcut creation upon its update
.PARAMETER Disable
Do not prevent desktop shortcut creation upon Microsoft Edge update
@ -11021,7 +11022,7 @@ function UninstallUWPApps
$Window.Close() | Out-Null
# If Xbox Game Bar is selected to uninstall stop its' processes
# If Xbox Game Bar is selected to uninstall stop its processes
if ($PackagesToRemove -match "Microsoft.XboxGamingOverlay")
{
Get-Process -Name GameBar, GameBarFTServer -ErrorAction Ignore | Stop-Process -Force
@ -14675,7 +14676,7 @@ public static void PostMessage()
Set-WinHomeLocation -GeoId $Script:Region
}
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its' own database
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its own database
if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt"))
{
if (Test-Path -Path "$env:TEMP\Computer.txt")
@ -14694,7 +14695,7 @@ public static void PostMessage()
# https://github.com/PowerShell/PowerShell/issues/21070
Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Recurse -Force -ErrorAction Ignore
# Kill all explorer instances in case launch folder windows in a separate process enabled
# Kill all explorer instances in case "launch folder windows in a separate process" enabled
Get-Process -Name explorer | Stop-Process -Force
Start-Sleep -Seconds 3
@ -14710,7 +14711,7 @@ public static void PostMessage()
# Check whether any of scheduled tasks were created. Unless open Task Scheduler
if ($Script:ScheduledTasks)
{
# Find and close taskschd.msc by its' argument
# Find and close taskschd.msc by its argument
$taskschd_Process_ID = (Get-CimInstance -ClassName CIM_Process | Where-Object -FilterScript {$_.Name -eq "mmc.exe"} | Where-Object -FilterScript {
$_.CommandLine -match "taskschd.msc"
}).Handle
@ -14829,13 +14830,6 @@ public static void PostMessage()
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage)
#endregion Toast notifications
# Check for UWP apps updates
Write-Information -MessageData "" -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose
Get-CimInstance -Namespace root/CIMV2/mdm/dmmap -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 | Invoke-CimMethod -MethodName UpdateScanMethod
}
#endregion Post Actions

4
src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1

@ -12,7 +12,7 @@
.DESCRIPTION
Place the "#" char before function if you don't want to run it
Remove the "#" char before function if you want to run it
Every tweak in the preset file has its' corresponding function to restore the default settings
Every tweak in the preset file has its corresponding function to restore the default settings
.EXAMPLE Run the whole script
.\Sophia.ps1
@ -1011,7 +1011,7 @@ RKNBypass -Enable
# Включить все необходимые зависимости (может потребоваться перезагрузка) и открыть страницу WSA в Microsoft Store, чтобы вручную установить Windows Subsystem for Android™ with Amazon Appstore
# Install-WSA
# List Microsoft Edge channels to prevent desktop shortcut creation upon its' update
# List Microsoft Edge channels to prevent desktop shortcut creation upon its update
# Перечислите каналы Microsoft Edge для предотвращения создания ярлыков на рабочем столе после его обновления
PreventEdgeShortcutCreation -Channels Stable, Beta, Dev, Canary

Loading…
Cancel
Save