Browse Source

Minor improvements

master
Dmitry Nefedov 5 months ago
parent
commit
a6e0064daf
  1. 19
      src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
  2. 4
      src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1
  3. 4
      src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1
  4. 19
      src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
  5. 11
      src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
  6. 11
      src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

19
src/Sophia_Script_for_Windows_10/Module/Sophia.psm1

@ -282,11 +282,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Check whether Windows was broken by 3rd party harmful tweakers and trojans # Check whether Windows was broken by 3rd party harmful tweakers and trojans
$Tweakers = @{ $Tweakers = @{
# https://forum.ru-board.com/topic.cgi?forum=62&topic=30617&start=1600#14 # https://forum.ru-board.com/topic.cgi?forum=62&topic=30617&start=1600#14
AutoSettingsPS = "$(Get-Item -Path `"HKLM:\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths`" | Where-Object -FilterScript {$_.Property -match `"AutoSettingsPS`"})" AutoSettingsPS = "$(Get-WinEvent -LogName `"Windows PowerShell`" | Where-Object -FilterScript {($_.Id -eq 800) -and ($_.Message -match `"AutoSettingsPS`")} | Select-Object -First 1)"
# Flibustier custom Windows image # Flibustier custom Windows image
Flibustier = "$(Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\.NETFramework\Performance -Name *flibustier)" Flibustier = "$(Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\.NETFramework\Performance -Name *flibustier)"
# https://github.com/hellzerg/optimizer
Optimizer = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"optimizer`"})"
# https://github.com/builtbybel/Winpilot # https://github.com/builtbybel/Winpilot
Winpilot = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"Winpilot`"})" Winpilot = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"Winpilot`"})"
# https://forum.ru-board.com/topic.cgi?forum=5&topic=50519 # https://forum.ru-board.com/topic.cgi?forum=5&topic=50519
@ -3969,31 +3967,26 @@ function UnpinTaskbarShortcuts
$Shell = (New-Object -ComObject Shell.Application).NameSpace("$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar") $Shell = (New-Object -ComObject Shell.Application).NameSpace("$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar")
$Shortcut = $Shell.ParseName("Microsoft Edge.lnk") $Shortcut = $Shell.ParseName("Microsoft Edge.lnk")
# Extract the localized "Unpin from taskbar" string from shell32.dll # Extract the localized "Unpin from taskbar" string from shell32.dll
$Shortcut.Verbs() | Where-Object -FilterScript {$_.Name -eq "$([WinAPI.GetStrings]::GetString(5387))"} | ForEach-Object -Process {$_.DoIt()} $Shortcut.Verbs() | Where-Object -FilterScript {$_.Name -eq $LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} }
} }
Store 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 {$_.Name -eq "Microsoft Store"}) if ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"})
{ {
Start-Job -ScriptBlock {
# Extract the localized "Unpin from taskbar" string from shell32.dll # Extract the localized "Unpin from taskbar" string from shell32.dll
((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript { ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {
$_.Name -eq "Microsoft Store" $_.Name -eq "Microsoft Store"
}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()} }).Verbs() | Where-Object -FilterScript {$_.Name -eq $LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} | Receive-Job -Wait -AutoRemoveJob
} }
} }
Mail Mail
{ {
# Start-Job is used due to that the calling this function before UninstallUWPApps breaks the retrieval of the localized UWP apps packages names
if (Get-AppxPackage -Name microsoft.windowscommunicationsapps) if (Get-AppxPackage -Name microsoft.windowscommunicationsapps)
{ {
Start-Job -ScriptBlock { ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {
$Apps = (New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() $_.Path -match "microsoft.windowscommunicationsapp"
($Apps | Where-Object -FilterScript {$_.Path -eq "microsoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.windowslive.mail"}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()} }).Verbs() | Where-Object -FilterScript {$_.Name -eq $LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} | Receive-Job -Wait -AutoRemoveJob
} }
} }
} }

4
src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1

@ -282,11 +282,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Check whether Windows was broken by 3rd party harmful tweakers and trojans # Check whether Windows was broken by 3rd party harmful tweakers and trojans
$Tweakers = @{ $Tweakers = @{
# https://forum.ru-board.com/topic.cgi?forum=62&topic=30617&start=1600#14 # https://forum.ru-board.com/topic.cgi?forum=62&topic=30617&start=1600#14
AutoSettingsPS = "$(Get-Item -Path `"HKLM:\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths`" | Where-Object -FilterScript {$_.Property -match `"AutoSettingsPS`"})" AutoSettingsPS = "$(Get-WinEvent -LogName `"Windows PowerShell`" | Where-Object -FilterScript {($_.Id -eq 800) -and ($_.Message -match `"AutoSettingsPS`")} | Select-Object -First 1)"
# Flibustier custom Windows image # Flibustier custom Windows image
Flibustier = "$(Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\.NETFramework\Performance -Name *flibustier)" Flibustier = "$(Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\.NETFramework\Performance -Name *flibustier)"
# https://github.com/hellzerg/optimizer
Optimizer = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"optimizer`"})"
# https://github.com/builtbybel/Winpilot # https://github.com/builtbybel/Winpilot
Winpilot = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"Winpilot`"})" Winpilot = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"Winpilot`"})"
# https://forum.ru-board.com/topic.cgi?forum=5&topic=50519 # https://forum.ru-board.com/topic.cgi?forum=5&topic=50519

4
src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1

@ -282,11 +282,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Check whether Windows was broken by 3rd party harmful tweakers and trojans # Check whether Windows was broken by 3rd party harmful tweakers and trojans
$Tweakers = @{ $Tweakers = @{
# https://forum.ru-board.com/topic.cgi?forum=62&topic=30617&start=1600#14 # https://forum.ru-board.com/topic.cgi?forum=62&topic=30617&start=1600#14
AutoSettingsPS = "$(Get-Item -Path `"HKLM:\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths`" | Where-Object -FilterScript {$_.Property -match `"AutoSettingsPS`"})" AutoSettingsPS = "$(Get-WinEvent -LogName `"Windows PowerShell`" | Where-Object -FilterScript {($_.Id -eq 800) -and ($_.Message -match `"AutoSettingsPS`")} | Select-Object -First 1)"
# Flibustier custom Windows image # Flibustier custom Windows image
Flibustier = "$(Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\.NETFramework\Performance -Name *flibustier)" Flibustier = "$(Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\.NETFramework\Performance -Name *flibustier)"
# https://github.com/hellzerg/optimizer
Optimizer = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"optimizer`"})"
# https://github.com/builtbybel/Winpilot # https://github.com/builtbybel/Winpilot
Winpilot = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"Winpilot`"})" Winpilot = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"Winpilot`"})"
# https://forum.ru-board.com/topic.cgi?forum=5&topic=50519 # https://forum.ru-board.com/topic.cgi?forum=5&topic=50519

19
src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1

@ -281,11 +281,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Check whether Windows was broken by 3rd party harmful tweakers and trojans # Check whether Windows was broken by 3rd party harmful tweakers and trojans
$Tweakers = @{ $Tweakers = @{
# https://forum.ru-board.com/topic.cgi?forum=62&topic=30617&start=1600#14 # https://forum.ru-board.com/topic.cgi?forum=62&topic=30617&start=1600#14
AutoSettingsPS = "$(Get-Item -Path `"HKLM:\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths`" | Where-Object -FilterScript {$_.Property -match `"AutoSettingsPS`"})" AutoSettingsPS = "$(Get-WinEvent -LogName `"Windows PowerShell`" | Where-Object -FilterScript {($_.Id -eq 800) -and ($_.Message -match `"AutoSettingsPS`")} | Select-Object -First 1)"
# Flibustier custom Windows image # Flibustier custom Windows image
Flibustier = "$(Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\.NETFramework\Performance -Name *flibustier)" Flibustier = "$(Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\.NETFramework\Performance -Name *flibustier)"
# https://github.com/hellzerg/optimizer
Optimizer = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"optimizer`"})"
# https://github.com/builtbybel/Winpilot # https://github.com/builtbybel/Winpilot
Winpilot = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"Winpilot`"})" Winpilot = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"Winpilot`"})"
# https://forum.ru-board.com/topic.cgi?forum=5&topic=50519 # https://forum.ru-board.com/topic.cgi?forum=5&topic=50519
@ -3978,26 +3976,21 @@ function UnpinTaskbarShortcuts
} }
Store 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 {$_.Name -eq "Microsoft Store"}) if ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"})
{ {
Start-Job -ScriptBlock {
# Extract the localized "Unpin from taskbar" string from shell32.dll # Extract the localized "Unpin from taskbar" string from shell32.dll
((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript { ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {
$_.Name -eq "Microsoft Store" $_.Name -eq "Microsoft Store"
}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()} }).Verbs() | Where-Object -FilterScript {$_.Name -eq $LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} | Receive-Job -Wait -AutoRemoveJob
} }
} }
Mail Mail
{ {
# Start-Job is used due to that the calling this function before UninstallUWPApps breaks the retrieval of the localized UWP apps packages names
if (Get-AppxPackage -Name microsoft.windowscommunicationsapps) if (Get-AppxPackage -Name microsoft.windowscommunicationsapps)
{ {
Start-Job -ScriptBlock { ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {
$Apps = (New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() $_.Path -match "microsoft.windowscommunicationsapp"
($Apps | Where-Object -FilterScript {$_.Path -eq "microsoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.windowslive.mail"}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()} }).Verbs() | Where-Object -FilterScript {$_.Name -eq $LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} | Receive-Job -Wait -AutoRemoveJob
} }
} }
} }
@ -11360,7 +11353,7 @@ function UninstallUWPApps
} }
} }
$PackagesIds = [Windows.Management.Deployment.PackageManager, Windows.Web, ContentType = WindowsRuntime]::new().FindPackages() | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName $PackagesIds = [Windows.Management.Deployment.PackageManager]::new().FindPackages() | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
foreach ($AppxPackage in $AppxPackages) foreach ($AppxPackage in $AppxPackages)
{ {
$PackageId = $PackagesIds | Where-Object -FilterScript {$_.Name -eq $AppxPackage.Name} $PackageId = $PackagesIds | Where-Object -FilterScript {$_.Name -eq $AppxPackage.Name}

11
src/Sophia_Script_for_Windows_11/Module/Sophia.psm1

@ -268,11 +268,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Check whether Windows was broken by 3rd party harmful tweakers and trojans # Check whether Windows was broken by 3rd party harmful tweakers and trojans
$Tweakers = @{ $Tweakers = @{
# https://forum.ru-board.com/topic.cgi?forum=62&topic=30617&start=1600#14 # https://forum.ru-board.com/topic.cgi?forum=62&topic=30617&start=1600#14
AutoSettingsPS = "$(Get-Item -Path `"HKLM:\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths`" | Where-Object -FilterScript {$_.Property -match `"AutoSettingsPS`"})" AutoSettingsPS = "$(Get-WinEvent -LogName `"Windows PowerShell`" | Where-Object -FilterScript {($_.Id -eq 800) -and ($_.Message -match `"AutoSettingsPS`")} | Select-Object -First 1)"
# Flibustier custom Windows image # Flibustier custom Windows image
Flibustier = "$(Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\.NETFramework\Performance -Name *flibustier)" Flibustier = "$(Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\.NETFramework\Performance -Name *flibustier)"
# https://github.com/hellzerg/optimizer
Optimizer = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"optimizer`"})"
# https://github.com/builtbybel/Winpilot # https://github.com/builtbybel/Winpilot
Winpilot = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"Winpilot`"})" Winpilot = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"Winpilot`"})"
# https://forum.ru-board.com/topic.cgi?forum=5&topic=50519 # https://forum.ru-board.com/topic.cgi?forum=5&topic=50519
@ -3697,20 +3695,17 @@ function UnpinTaskbarShortcuts
$Shell = (New-Object -ComObject Shell.Application).NameSpace("$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar") $Shell = (New-Object -ComObject Shell.Application).NameSpace("$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar")
$Shortcut = $Shell.ParseName("Microsoft Edge.lnk") $Shortcut = $Shell.ParseName("Microsoft Edge.lnk")
# Extract the localized "Unpin from taskbar" string from shell32.dll # Extract the localized "Unpin from taskbar" string from shell32.dll
$Shortcut.Verbs() | Where-Object -FilterScript {$_.Name -eq "$([WinAPI.GetStrings]::GetString(5387))"} | ForEach-Object -Process {$_.DoIt()} $Shortcut.Verbs() | Where-Object -FilterScript {$_.Name -eq $LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} }
} }
Store 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 {$_.Name -eq "Microsoft Store"}) if ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"})
{ {
Start-Job -ScriptBlock {
# Extract the localized "Unpin from taskbar" string from shell32.dll # Extract the localized "Unpin from taskbar" string from shell32.dll
((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript { ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {
$_.Name -eq "Microsoft Store" $_.Name -eq "Microsoft Store"
}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()} }).Verbs() | Where-Object -FilterScript {$_.Name -eq $LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} | Receive-Job -Wait -AutoRemoveJob
} }
} }
} }

11
src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

@ -267,11 +267,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Check whether Windows was broken by 3rd party harmful tweakers and trojans # Check whether Windows was broken by 3rd party harmful tweakers and trojans
$Tweakers = @{ $Tweakers = @{
# https://forum.ru-board.com/topic.cgi?forum=62&topic=30617&start=1600#14 # https://forum.ru-board.com/topic.cgi?forum=62&topic=30617&start=1600#14
AutoSettingsPS = "$(Get-Item -Path `"HKLM:\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths`" | Where-Object -FilterScript {$_.Property -match `"AutoSettingsPS`"})" AutoSettingsPS = "$(Get-WinEvent -LogName `"Windows PowerShell`" | Where-Object -FilterScript {($_.Id -eq 800) -and ($_.Message -match `"AutoSettingsPS`")} | Select-Object -First 1)"
# Flibustier custom Windows image # Flibustier custom Windows image
Flibustier = "$(Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\.NETFramework\Performance -Name *flibustier)" Flibustier = "$(Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\.NETFramework\Performance -Name *flibustier)"
# https://github.com/hellzerg/optimizer
Optimizer = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"optimizer`"})"
# https://github.com/builtbybel/Winpilot # https://github.com/builtbybel/Winpilot
Winpilot = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"Winpilot`"})" Winpilot = "$((Get-ItemProperty -Path `"HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache`").PSObject.Properties | Where-Object -FilterScript {$_.Value -eq `"Winpilot`"})"
# https://forum.ru-board.com/topic.cgi?forum=5&topic=50519 # https://forum.ru-board.com/topic.cgi?forum=5&topic=50519
@ -3715,20 +3713,17 @@ function UnpinTaskbarShortcuts
$Shell = (New-Object -ComObject Shell.Application).NameSpace("$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar") $Shell = (New-Object -ComObject Shell.Application).NameSpace("$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar")
$Shortcut = $Shell.ParseName("Microsoft Edge.lnk") $Shortcut = $Shell.ParseName("Microsoft Edge.lnk")
# Extract the localized "Unpin from taskbar" string from shell32.dll # Extract the localized "Unpin from taskbar" string from shell32.dll
$Shortcut.Verbs() | Where-Object -FilterScript {$_.Name -eq "$([WinAPI.GetStrings]::GetString(5387))"} | ForEach-Object -Process {$_.DoIt()} $Shortcut.Verbs() | Where-Object -FilterScript {$_.Name -eq $LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} }
} }
Store 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 {$_.Name -eq "Microsoft Store"}) if ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"})
{ {
Start-Job -ScriptBlock {
# Extract the localized "Unpin from taskbar" string from shell32.dll # Extract the localized "Unpin from taskbar" string from shell32.dll
((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript { ((New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | Where-Object -FilterScript {
$_.Name -eq "Microsoft Store" $_.Name -eq "Microsoft Store"
}).Verbs() | Where-Object -FilterScript {$_.Name -eq $using:LocalizedString} | ForEach-Object -Process {$_.DoIt()} }).Verbs() | Where-Object -FilterScript {$_.Name -eq $LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} | Receive-Job -Wait -AutoRemoveJob
} }
} }
} }

Loading…
Cancel
Save