@ -2,8 +2,8 @@
. SYNOPSIS
. SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version : v5 . 12 . 2
Version : v5 . 12 . 3
Date : 25 . 08 . 2021
Date : 19 . 09 . 2021
Copyright ( c ) 2014 – 2021 farag
Copyright ( c ) 2014 – 2021 farag
Copyright ( c ) 2019 – 2021 farag & Inestic
Copyright ( c ) 2019 – 2021 farag & Inestic
@ -31,15 +31,15 @@
https : / / t . me / sophianews
https : / / t . me / sophianews
https : / / t . me / sophia_chat
https : / / t . me / sophia_chat
. LINK Authors
. NOTES
https : / / github . com / farag2
https : / / github . com / Inestic
. LINK
https : / / forum . ru-board . com / topic . cgi ? forum = 62 & topic = 30617 #15
https : / / forum . ru-board . com / topic . cgi ? forum = 62 & topic = 30617 #15
https : / / habr . com / company / skillfactory / blog / 553800 /
https : / / habr . com / company / skillfactory / blog / 553800 /
https : / / forums . mydigitallife . net / threads / powershell-windows - 10 -sophia -script . 81675 /
https : / / forums . mydigitallife . net / threads / powershell-windows - 10 -sophia -script . 81675 /
https : / / www . reddit . com / r / PowerShell / comments / go2n5v / powershell_script_setup_windows_10 /
https : / / www . reddit . com / r / PowerShell / comments / go2n5v / powershell_script_setup_windows_10 /
. LINK Authors
https : / / github . com / farag2
https : / / github . com / Inestic
#>
#>
#region Checkings
#region Checkings
@ -85,10 +85,18 @@ function Checkings
$Version = Get-ItemPropertyValue -Path " HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion " -Name UBR
$Version = Get-ItemPropertyValue -Path " HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion " -Name UBR
Write-Warning -Message ( $Localization . UpdateWarning -f $Version )
Write-Warning -Message ( $Localization . UpdateWarning -f $Version )
# Check for updates
# Receive updates for other Microsoft products when you update Windows
( New-Object -ComObject Microsoft . Update . ServiceManager ) . AddService2 ( " 7971f918-a847-4430-9279-4a52d1efe18d " , 7 , " " )
Start-Sleep -Seconds 1
# Open the "Windows Update" page
Start-Process -FilePath " ms-settings:windowsupdate-action "
Start-Process -FilePath " ms-settings:windowsupdate-action "
Start-Sleep -Seconds 3
Start-Process -FilePath " ms-settings:windowsupdate-optionalupdates "
Start-Sleep -Seconds 1
# Trigger Windows Update for detecting new updates
( New-Object -ComObject Microsoft . Update . AutoUpdate ) . DetectNow ( )
exit
exit
}
}
@ -174,7 +182,7 @@ function Checkings
}
}
# Unblock all files in the script folder by removing the Zone.Identifier alternate data stream with a value of "3"
# Unblock all files in the script folder by removing the Zone.Identifier alternate data stream with a value of "3"
Get-ChildItem -Path $PSScriptRoot -Recurse -Force | Unblock-File
Get-ChildItem -Path $PSScriptRoot \ . . \ -File -Recurse -Force | Unblock-File
# Display a warning message about whether a user has customized the preset file
# Display a warning message about whether a user has customized the preset file
if ( $Warning )
if ( $Warning )
@ -227,12 +235,12 @@ function Checkings
#endregion Checkings
#endregion Checkings
#region Protection
#region Protection
# Enable script logging. The log will be being recorded into the script folder
# Enable script logging. The log will be being recorded into the script root folder
# To stop logging just close the console or type "Stop-Transcript"
# To stop logging just close the console or type "Stop-Transcript"
function Logging
function Logging
{
{
$TrascriptFilename = " Log- $( ( Get-Date ) . ToString ( " dd.MM.yyyy-HH-mm " ) ) "
$TrascriptFilename = " Log- $( ( Get-Date ) . ToString ( " dd.MM.yyyy-HH-mm " ) ) "
Start-Transcript -Path $PSScriptRoot \ $TrascriptFilename . txt -Force
Start-Transcript -Path $PSScriptRoot \ . . \ $TrascriptFilename . txt -Force
}
}
# Create a restore point for the system drive
# Create a restore point for the system drive
@ -509,7 +517,7 @@ function FeedbackFrequency
}
}
" Automatically "
" Automatically "
{
{
Remove-Item -Path HKCU : \ SOFTWARE \ Microsoft \ Siuf \ Rules -Force -ErrorAction SilentlyContinu e
Remove-Item -Path HKCU : \ SOFTWARE \ Microsoft \ Siuf \ Rules -Force -ErrorAction Ignor e
}
}
}
}
}
}
@ -796,10 +804,13 @@ function ScheduledTasks
if ( -not ( $Tasks ) )
if ( -not ( $Tasks ) )
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . NoData -Verbose
Write-Verbose -Message $Localization . NoData -Verbose
return
return
}
}
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . DialogBoxOpening -Verbose
Write-Verbose -Message $Localization . DialogBoxOpening -Verbose
#region Sendkey function
#region Sendkey function
@ -2082,7 +2093,7 @@ function 3DObjects
}
}
" Show "
" Show "
{
{
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag " -Name ThisPCPolicy -Force -ErrorAction SilentlyContinu e
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag " -Name ThisPCPolicy -Force -ErrorAction Ignor e
}
}
}
}
@ -2751,9 +2762,8 @@ public static string GetString(uint strId)
if ( Test-Path -Path " $ env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Edge.lnk " )
if ( Test-Path -Path " $ env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Edge.lnk " )
{
{
# Call the shortcut context menu item
# Call the shortcut context menu item
$Shell = New-Object -ComObject Shell . Application
$Shell = ( New-Object -ComObject Shell . Application ) . NameSpace ( " $ env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar " )
$Folder = $Shell . NameSpace ( " $ env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar " )
$Shortcut = $Shell . ParseName ( " Microsoft Edge.lnk " )
$Shortcut = $Folder . ParseName ( " Microsoft Edge.lnk " )
$Shortcut . Verbs ( ) | Where-Object -FilterScript { $_ . Name -eq $LocalizedString } | ForEach-Object -Process { $_ . DoIt ( ) }
$Shortcut . Verbs ( ) | Where-Object -FilterScript { $_ . Name -eq $LocalizedString } | ForEach-Object -Process { $_ . DoIt ( ) }
}
}
}
}
@ -3015,11 +3025,7 @@ function NewAppInstalledNotification
}
}
" Show "
" Show "
{
{
if ( -not ( Test-Path -Path HKLM : \ SOFTWARE \ Policies \ Microsoft \ Windows \ Explorer ) )
Remove-ItemProperty -Path HKLM : \ SOFTWARE \ Policies \ Microsoft \ Windows \ Explorer -Name NoNewAppAlert -Force
{
New-Item -Path HKLM : \ SOFTWARE \ Policies \ Microsoft \ Windows \ Explorer -Force
}
New-ItemProperty -Path HKLM : \ SOFTWARE \ Policies \ Microsoft \ Windows \ Explorer -Name NoNewAppAlert -PropertyType DWord -Value 0 -Force
}
}
}
}
}
}
@ -3066,11 +3072,11 @@ function FirstLogonAnimation
{
{
" Disable "
" Disable "
{
{
New-ItemProperty -Path HKLM : \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Policies \ System -Name EnableFirstLogonAnimation -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon " -Name EnableFirstLogonAnimation -PropertyType DWord -Value 0 -Force
}
}
" Enable "
" Enable "
{
{
New-ItemProperty -Path HKLM : \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Policies \ System -Name EnableFirstLogonAnimation -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon " -Name EnableFirstLogonAnimation -PropertyType DWord -Value 1 -Force
}
}
}
}
}
}
@ -3509,6 +3515,7 @@ function OneDrive
[string] $UninstallString = Get-Package -Name " Microsoft OneDrive " -ProviderName Programs -ErrorAction Ignore | ForEach-Object -Process { $_ . Meta . Attributes [ " UninstallString " ] }
[string] $UninstallString = Get-Package -Name " Microsoft OneDrive " -ProviderName Programs -ErrorAction Ignore | ForEach-Object -Process { $_ . Meta . Attributes [ " UninstallString " ] }
if ( $UninstallString )
if ( $UninstallString )
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . OneDriveUninstalling -Verbose
Write-Verbose -Message $Localization . OneDriveUninstalling -Verbose
Stop-Process -Name OneDrive -Force -ErrorAction Ignore
Stop-Process -Name OneDrive -Force -ErrorAction Ignore
@ -3648,25 +3655,40 @@ public static bool MarkFileDelete (string sourcefile)
{
{
if ( Test-Path -Path $env:SystemRoot \ SysWOW64 \ OneDriveSetup . exe )
if ( Test-Path -Path $env:SystemRoot \ SysWOW64 \ OneDriveSetup . exe )
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . OneDriveInstalling -Verbose
Write-Verbose -Message $Localization . OneDriveInstalling -Verbose
Start-Process -FilePath $env:SystemRoot \ SysWOW64 \ OneDriveSetup . exe
Start-Process -FilePath $env:SystemRoot \ SysWOW64 \ OneDriveSetup . exe
}
}
else
else
{
{
# Downloading the latest OneDrive
try
try
{
{
# Downloading the latest OneDrive installer x64
if ( ( Invoke-WebRequest -Uri https : / / www . google . com -UseBasicParsing -DisableKeepAlive -Method Head ) . StatusDescription )
if ( ( Invoke-WebRequest -Uri https : / / www . google . com -UseBasicParsing -DisableKeepAlive -Method Head ) . StatusDescription )
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . OneDriveDownloading -Verbose
Write-Verbose -Message $Localization . OneDriveDownloading -Verbose
[Net.ServicePointManager] :: SecurityProtocol = [Net.SecurityProtocolType] :: Tls12
[Net.ServicePointManager] :: SecurityProtocol = [Net.SecurityProtocolType] :: Tls12
# Parse XML to get the URL
# https://go.microsoft.com/fwlink/p/?LinkID=844652
$Parameters = @ {
Uri = " https://g.live.com/1rewlive5skydrive/OneDriveProduction "
UseBasicParsing = $true
Verbose = $true
}
$Content = Invoke-RestMethod @Parameters
# Remove invalid chars
[xml] $OneDriveXML = $Content -replace "  " , " "
$OneDriveURL = ( $OneDriveXML ) . root . update . amd64binary . url [ - 1 ]
$DownloadsFolder = Get-ItemPropertyValue -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
$DownloadsFolder = Get-ItemPropertyValue -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
$Parameters = @ {
$Parameters = @ {
Uri = " https://go.microsoft.com/fwlink/p/?LinkID=2121808 "
Uri = $OneDriveURL
OutFile = " $ DownloadsFolder\OneDriveSetup.exe "
OutFile = " $ DownloadsFolder\OneDriveSetup.exe "
Verbose = [switch] :: Present
Verbose = $true
}
}
Invoke-WebRequest @Parameters
Invoke-WebRequest @Parameters
@ -3685,6 +3707,7 @@ public static bool MarkFileDelete (string sourcefile)
}
}
Get-ScheduledTask -TaskName " Onedrive* Update* " | Enable-ScheduledTask
Get-ScheduledTask -TaskName " Onedrive* Update* " | Enable-ScheduledTask
Get-ScheduledTask -TaskName " Onedrive* Update* " | Start-ScheduledTask
}
}
}
}
}
}
@ -3926,10 +3949,10 @@ function Hibernation
The % TEMP % environment variable path
The % TEMP % environment variable path
. PARAMETER SystemDrive
. PARAMETER SystemDrive
Change the % TEMP % environment variable path to " %SystemDrive%\Temp "
Change the % TEMP % environment variable path to % SystemDrive % \ Temp
. PARAMETER Default
. PARAMETER Default
Change the % TEMP % environment variable path to " %LOCALAPPDATA%\Temp "
Change the % TEMP % environment variable path to % LOCALAPPDATA % \ Temp
. EXAMPLE
. EXAMPLE
TempFolder -SystemDrive
TempFolder -SystemDrive
@ -4057,7 +4080,7 @@ Unregister-ScheduledTask -TaskName SymbolicLink -Confirm:`$false
}
}
#region main
#region main
# Change the %TEMP% environment variable path to " %LOCALAPPDATA%\Temp"
# Change the %TEMP% environment variable path to %LOCALAPPDATA%\Temp
[Environment] :: SetEnvironmentVariable ( " TMP " , " $ env:SystemDrive\Temp " , " User " )
[Environment] :: SetEnvironmentVariable ( " TMP " , " $ env:SystemDrive\Temp " , " User " )
[Environment] :: SetEnvironmentVariable ( " TMP " , " $ env:SystemDrive\Temp " , " Machine " )
[Environment] :: SetEnvironmentVariable ( " TMP " , " $ env:SystemDrive\Temp " , " Machine " )
[Environment] :: SetEnvironmentVariable ( " TMP " , " $ env:SystemDrive\Temp " , " Process " )
[Environment] :: SetEnvironmentVariable ( " TMP " , " $ env:SystemDrive\Temp " , " Process " )
@ -4165,7 +4188,7 @@ Unregister-ScheduledTask -TaskName TemporaryTask -Confirm:`$false
}
}
#region main
#region main
# Change the %TEMP% environment variable path to " %LOCALAPPDATA%\Temp"
# Change the %TEMP% environment variable path to %LOCALAPPDATA%\Temp
[Environment] :: SetEnvironmentVariable ( " TMP " , " $ env:LOCALAPPDATA\Temp " , " User " )
[Environment] :: SetEnvironmentVariable ( " TMP " , " $ env:LOCALAPPDATA\Temp " , " User " )
[Environment] :: SetEnvironmentVariable ( " TMP " , " $ env:SystemRoot\TEMP " , " Machine " )
[Environment] :: SetEnvironmentVariable ( " TMP " , " $ env:SystemRoot\TEMP " , " Machine " )
[Environment] :: SetEnvironmentVariable ( " TMP " , " $ env:LOCALAPPDATA\Temp " , " Process " )
[Environment] :: SetEnvironmentVariable ( " TMP " , " $ env:LOCALAPPDATA\Temp " , " Process " )
@ -4383,7 +4406,7 @@ function MappedDrivesAppElevatedAccess
}
}
" Disable "
" Disable "
{
{
New -ItemProperty -Path HKLM : \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Policies \ System -Name EnableLinkedConnections -PropertyType DWord -Value 0 -Forc e
Remove -ItemProperty -Path HKLM : \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Policies \ System -Name EnableLinkedConnections -Force -ErrorAction Ignor e
}
}
}
}
}
}
@ -4806,6 +4829,7 @@ function WindowsFeatures
}
}
}
}
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Patient -Verbose
Write-Verbose -Message $Localization . Patient -Verbose
# Getting list of all optional features according to the conditions
# Getting list of all optional features according to the conditions
@ -4817,10 +4841,13 @@ function WindowsFeatures
if ( -not ( $Features ) )
if ( -not ( $Features ) )
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . NoData -Verbose
Write-Verbose -Message $Localization . NoData -Verbose
return
return
}
}
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . DialogBoxOpening -Verbose
Write-Verbose -Message $Localization . DialogBoxOpening -Verbose
#region Sendkey function
#region Sendkey function
@ -5089,6 +5116,7 @@ function WindowsCapabilities
function UninstallButton
function UninstallButton
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Patient -Verbose
Write-Verbose -Message $Localization . Patient -Verbose
[void] $Window . Close ( )
[void] $Window . Close ( )
@ -5098,12 +5126,14 @@ function WindowsCapabilities
if ( [string] $SelectedCapabilities . Name -match " Browser.InternetExplorer " )
if ( [string] $SelectedCapabilities . Name -match " Browser.InternetExplorer " )
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . RestartWarning
Write-Warning -Message $Localization . RestartWarning
}
}
}
}
function InstallButton
function InstallButton
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Patient -Verbose
Write-Verbose -Message $Localization . Patient -Verbose
[void] $Window . Close ( )
[void] $Window . Close ( )
@ -5113,6 +5143,7 @@ function WindowsCapabilities
if ( [string] $SelectedCapabilities . Name -match " Browser.InternetExplorer " )
if ( [string] $SelectedCapabilities . Name -match " Browser.InternetExplorer " )
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . RestartWarning
Write-Warning -Message $Localization . RestartWarning
}
}
}
}
@ -5190,6 +5221,7 @@ function WindowsCapabilities
}
}
}
}
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Patient -Verbose
Write-Verbose -Message $Localization . Patient -Verbose
# Getting list of all capabilities according to the conditions
# Getting list of all capabilities according to the conditions
@ -5201,10 +5233,13 @@ function WindowsCapabilities
if ( -not ( $Capabilities ) )
if ( -not ( $Capabilities ) )
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . NoData -Verbose
Write-Verbose -Message $Localization . NoData -Verbose
return
return
}
}
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . DialogBoxOpening -Verbose
Write-Verbose -Message $Localization . DialogBoxOpening -Verbose
#region Sendkey function
#region Sendkey function
@ -5954,6 +5989,7 @@ public static string GetString(uint strId)
{
{
" Root "
" Root "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . RetrievingDrivesList -Verbose
Write-Verbose -Message $Localization . RetrievingDrivesList -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -5977,7 +6013,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DesktopLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DesktopLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6011,7 +6046,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DocumentsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DocumentsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6045,7 +6079,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DownloadsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DownloadsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6079,7 +6112,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $MusicLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $MusicLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6111,8 +6143,8 @@ public static string GetString(uint strId)
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Pictures "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Pictures "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $PicturesLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $PicturesLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6146,7 +6178,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $VideosLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $VideosLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6180,7 +6211,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DesktopLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DesktopLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6224,7 +6254,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DocumentsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DocumentsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6268,7 +6297,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DownloadsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DownloadsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6312,7 +6340,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $MusicLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $MusicLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6356,7 +6383,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $PicturesLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $PicturesLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6400,7 +6426,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $VideosLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $VideosLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6446,7 +6471,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DesktopLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DesktopLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6477,7 +6501,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DocumentsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DocumentsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6508,7 +6531,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DownloadsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DownloadsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6539,7 +6561,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $MusicLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $MusicLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6570,7 +6591,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $PicturesLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $PicturesLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6601,7 +6621,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $VideosLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $VideosLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
@ -6704,14 +6723,14 @@ function WinPrtScrFolder
. SYNOPSIS
. SYNOPSIS
Recommended troubleshooter preferences
Recommended troubleshooter preferences
. PARAMETER Automatic
. PARAMETER Automatically
Run troubleshooter automatically , then notify me
Run troubleshooter automatically , then notify me
. PARAMETER Default
. PARAMETER Default
Ask me before running troubleshooter
Ask me before running troubleshooter
. EXAMPLE
. EXAMPLE
RecommendedTroubleshooting -Automatic
RecommendedTroubleshooting -Automatically
. EXAMPLE
. EXAMPLE
RecommendedTroubleshooting -Default
RecommendedTroubleshooting -Default
@ -6728,10 +6747,10 @@ function RecommendedTroubleshooting
(
(
[ Parameter (
[ Parameter (
Mandatory = $true ,
Mandatory = $true ,
ParameterSetName = " Automatic "
ParameterSetName = " Automatically "
) ]
) ]
[switch]
[switch]
$Automatic ,
$Automatically ,
[ Parameter (
[ Parameter (
Mandatory = $true ,
Mandatory = $true ,
@ -6743,7 +6762,7 @@ function RecommendedTroubleshooting
switch ( $PSCmdlet . ParameterSetName )
switch ( $PSCmdlet . ParameterSetName )
{
{
" Automatic "
" Automatically "
{
{
if ( -not ( Test-Path -Path HKLM : \ SOFTWARE \ Microsoft \ WindowsMitigation ) )
if ( -not ( Test-Path -Path HKLM : \ SOFTWARE \ Microsoft \ WindowsMitigation ) )
{
{
@ -6934,7 +6953,7 @@ function F1HelpPage
}
}
" Enable "
" Enable "
{
{
Remove-Item -Path " HKCU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee} " -Recurse -Force -ErrorAction SilentlyContinu e
Remove-Item -Path " HKCU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee} " -Recurse -Force -ErrorAction Ignor e
}
}
}
}
}
}
@ -7036,7 +7055,7 @@ function CapsLock
}
}
" Enable "
" Enable "
{
{
Remove-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout " -Name " Scancode Map " -Force
Remove-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout " -Name " Scancode Map " -Force -ErrorAction Ignore
}
}
}
}
}
}
@ -8034,6 +8053,7 @@ namespace FileAssoc
Set-Icon -ProgId $ProgId -Icon $Icon
Set-Icon -ProgId $ProgId -Icon $Icon
}
}
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Patient -Verbose
Write-Verbose -Message $Localization . Patient -Verbose
# Setting additional parameters to comply with the requirements before configuring the extension
# Setting additional parameters to comply with the requirements before configuring the extension
@ -8919,6 +8939,7 @@ function UninstallUWPApps
$AllUsers
$AllUsers
)
)
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Patient -Verbose
Write-Verbose -Message $Localization . Patient -Verbose
$AppxPackages = Get-AppxPackage -PackageTypeFilter Bundle -AllUsers : $AllUsers | Where-Object -FilterScript { $_ . Name -notin $ExcludedAppxPackages }
$AppxPackages = Get-AppxPackage -PackageTypeFilter Bundle -AllUsers : $AllUsers | Where-Object -FilterScript { $_ . Name -notin $ExcludedAppxPackages }
@ -9006,6 +9027,7 @@ function UninstallUWPApps
function ButtonUninstallClick
function ButtonUninstallClick
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Patient -Verbose
Write-Verbose -Message $Localization . Patient -Verbose
$Window . Close ( ) | Out-Null
$Window . Close ( ) | Out-Null
@ -9093,10 +9115,12 @@ function UninstallUWPApps
if ( $AppxPackages . Count -eq 0 )
if ( $AppxPackages . Count -eq 0 )
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . NoData -Verbose
Write-Verbose -Message $Localization . NoData -Verbose
}
}
else
else
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . DialogBoxOpening -Verbose
Write-Verbose -Message $Localization . DialogBoxOpening -Verbose
#region Sendkey function
#region Sendkey function
@ -9177,7 +9201,7 @@ function RestoreUWPApps
xmlns : x = " http://schemas.microsoft.com/winfx/2006/xaml "
xmlns : x = " http://schemas.microsoft.com/winfx/2006/xaml "
Name = " Window "
Name = " Window "
MinHeight = " 400 " MinWidth = " 410 "
MinHeight = " 400 " MinWidth = " 410 "
SizeToContent = " WidthAndHeight " WindowStartupLocation = " CenterScreen "
SizeToContent = " Width " WindowStartupLocation = " CenterScreen "
TextOptions . TextFormattingMode = " Display " SnapsToDevicePixels = " True "
TextOptions . TextFormattingMode = " Display " SnapsToDevicePixels = " True "
FontFamily = " Candara " FontSize = " 16 " ShowInTaskbar = " True "
FontFamily = " Candara " FontSize = " 16 " ShowInTaskbar = " True "
Background = " #F1F1F1 " Foreground = " #262626 " >
Background = " #F1F1F1 " Foreground = " #262626 " >
@ -9254,6 +9278,7 @@ function RestoreUWPApps
#region Functions
#region Functions
function Get-AppxManifest
function Get-AppxManifest
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Patient -Verbose
Write-Verbose -Message $Localization . Patient -Verbose
# You cannot retrieve packages using -PackageTypeFilter Bundle, otherwise you won't get the InstallLocation attribute. It can be retrieved only by comparing with $Bundles
# You cannot retrieve packages using -PackageTypeFilter Bundle, otherwise you won't get the InstallLocation attribute. It can be retrieved only by comparing with $Bundles
@ -9327,6 +9352,7 @@ function RestoreUWPApps
function ButtonRestoreClick
function ButtonRestoreClick
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Patient -Verbose
Write-Verbose -Message $Localization . Patient -Verbose
$Window . Close ( ) | Out-Null
$Window . Close ( ) | Out-Null
@ -9335,8 +9361,8 @@ function RestoreUWPApps
Register = $true
Register = $true
ForceApplicationShutdown = $true
ForceApplicationShutdown = $true
ForceUpdateFromAnyVersion = $true
ForceUpdateFromAnyVersion = $true
DisableDevelopmentMod = $true
DisableDevelopmentMode = $true
Verbose = [switch] :: Present
Verbose = $true
}
}
$PackagesToRestore | Add-AppxPackage @Parameters
$PackagesToRestore | Add-AppxPackage @Parameters
}
}
@ -9409,10 +9435,12 @@ function RestoreUWPApps
if ( $AppxPackages . Count -eq 0 )
if ( $AppxPackages . Count -eq 0 )
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . NoData -Verbose
Write-Verbose -Message $Localization . NoData -Verbose
}
}
else
else
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . DialogBoxOpening -Verbose
Write-Verbose -Message $Localization . DialogBoxOpening -Verbose
#region Sendkey function
#region Sendkey function
@ -9519,7 +9547,7 @@ function HEIF
" Install "
" Install "
{
{
# Check whether the extension is already installed
# Check whether the extension is already installed
if ( -not ( Get-AppxPackage -Name Microsoft . HEVCVideoExtension ) -and ( Get-AppxPackage -Name Microsoft . Windows . Photos ) )
if ( ( -not ( Get-AppxPackage -Name Microsoft . HEVCVideoExtension ) ) -and ( Get-AppxPackage -Name Microsoft . Windows . Photos ) )
{
{
try
try
{
{
@ -9559,7 +9587,7 @@ function HEIF
$Parameters = @ {
$Parameters = @ {
Uri = $TempURL
Uri = $TempURL
OutFile = " $ DownloadsFolder\ $ Package "
OutFile = " $ DownloadsFolder\ $ Package "
Verbose = [switch] :: Present
Verbose = $true
}
}
Invoke-WebRequest @Parameters
Invoke-WebRequest @Parameters
@ -9722,43 +9750,28 @@ function BackgroundUWPApps
{
{
" Disable "
" Disable "
{
{
# Remove all excluded apps running in the background
Get-ChildItem -Path HKCU : \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ BackgroundAccessApplications | ForEach-Object -Process {
Get-ChildItem -Path HKCU : \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ BackgroundAccessApplications | ForEach-Object -Process {
Remove-ItemProperty -Path $_ . PsPath -Name * -Force
Remove-ItemProperty -Path $_ . PsPath -Name * -Force
}
}
$ExcludedBackgroundApps = @ (
# Exclude apps from the Bundle only
# Lock screen app
$BackgroundAccessApplications = @ ( ( Get-ChildItem -Path HKCU : \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ BackgroundAccessApplications ) . PSChildName )
" Microsoft.LockApp " ,
$ExcludedBackgroundAccessApplications = @ ( )
foreach ( $BackgroundAccessApplication in $BackgroundAccessApplications )
# Content Delivery Manager (delivers Windows Spotlight wallpapers to the lock screen)
{
" Microsoft.Windows.ContentDeliveryManager " ,
if ( Get-AppxPackage -PackageTypeFilter Bundle -AllUsers | Where-Object -FilterScript { $_ . PackageFamilyName -eq $BackgroundAccessApplication } )
{
# Cortana
$ExcludedBackgroundAccessApplications + = $BackgroundAccessApplication
" Microsoft.Windows.Cortana " ,
}
}
# Windows Search
" Microsoft.Windows.Search " ,
# Windows Security
" Microsoft.Windows.SecHealthUI " ,
# Windows Shell Experience (Action center, snipping support, toast notification, touch screen keyboard)
" Microsoft.Windows.ShellExperienceHost " ,
# The Start menu
" Microsoft.Windows.StartMenuExperienceHost " ,
# Microsoft Store
Get-ChildItem -Path HKCU : \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ BackgroundAccessApplications | Where-Object -FilterScript { $_ . PSChildName -in $ExcludedBackgroundAccessApplications } | ForEach-Object -Process {
" Microsoft.WindowsStore "
)
$OFS = " | "
Get-ChildItem -Path HKCU : \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ BackgroundAccessApplications | Where-Object -FilterScript { $_ . PSChildName -notmatch " ^ $( $ExcludedBackgroundApps . ForEach ( { [regex] :: Escape ( $_ ) } ) ) " } | ForEach-Object -Process {
New-ItemProperty -Path $_ . PsPath -Name Disabled -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path $_ . PsPath -Name Disabled -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path $_ . PsPath -Name DisabledByUser -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path $_ . PsPath -Name DisabledByUser -PropertyType DWord -Value 1 -Force
}
}
$OFS = " "
# Open "Background apps" page
# Open the "Background apps" page
Start-Process -FilePath ms-settings : privacy-backgroundapps
Start-Process -FilePath ms-settings : privacy-backgroundapps
}
}
" Enable "
" Enable "
@ -9949,6 +9962,7 @@ function SetAppGraphicsPerformance
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
@ -10864,7 +10878,7 @@ function EventViewerCustomView
}
}
" Disable "
" Disable "
{
{
Remove-Item -Path " $ env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml " -Force -ErrorAction SilentlyContinu e
Remove-Item -Path " $ env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml " -Force -ErrorAction Ignor e
}
}
}
}
}
}
@ -11288,16 +11302,15 @@ function MSIExtractContext
{
{
New-Item -Path Registry :: HKEY_CLASSES_ROOT \ Msi . Package \ shell \ Extract \ Command -Force
New-Item -Path Registry :: HKEY_CLASSES_ROOT \ Msi . Package \ shell \ Extract \ Command -Force
}
}
$Value = " {0} " -f 'msiexec.exe /a "%1" /qb TARGETDIR="%1 extracted"'
$Value = " {0} " -f " msiexec.exe /a `" %1 `" /qb TARGETDIR= `" %1 extracted `" "
New-ItemProperty -Path Registry :: HKEY_CLASSES_ROOT \ Msi . Package \ shell \ Extract \ Command -Name " (default) " -PropertyType String -Value $Value -Force
New-ItemProperty -Path Registry :: HKEY_CLASSES_ROOT \ Msi . Package \ shell \ Extract \ Command -Name " (default) " -PropertyType String -Value $Value -Force
New-ItemProperty -Path Registry :: HKEY_CLASSES_ROOT \ Msi . Package \ shell \ Extract -Name MUIVerb -PropertyType String -Value " @shell32.dll,-37514 " -Force
New-ItemProperty -Path Registry :: HKEY_CLASSES_ROOT \ Msi . Package \ shell \ Extract -Name MUIVerb -PropertyType String -Value " @shell32.dll,-37514 " -Force
New-ItemProperty -Path Registry :: HKEY_CLASSES_ROOT \ Msi . Package \ shell \ Extract -Name Icon -PropertyType String -Value " shell32.dll,-16817 " -Force
New-ItemProperty -Path Registry :: HKEY_CLASSES_ROOT \ Msi . Package \ shell \ Extract -Name Icon -PropertyType String -Value " shell32.dll,-16817 " -Force
}
}
" Hide "
" Hide "
{
{
Remove-Item -Path Registry :: HKEY_CLASSES_ROOT \ Msi . Package \ shell \ Extract -Recurse -Force -ErrorAction SilentlyContinu e
Remove-Item -Path Registry :: HKEY_CLASSES_ROOT \ Msi . Package \ shell \ Extract -Recurse -Force -ErrorAction Ignor e
}
}
}
}
}
}
@ -11354,9 +11367,8 @@ function CABInstallContext
}
}
" Hide "
" Hide "
{
{
Remove-Item -Path Registry :: HKEY_CLASSES_ROOT \ CABFolder \ Shell \ RunAs -Recurse -Force -ErrorAction SilentlyContinu e
Remove-Item -Path Registry :: HKEY_CLASSES_ROOT \ CABFolder \ Shell \ RunAs -Recurse -Force -ErrorAction Ignor e
}
}
}
}
}
}
@ -11579,7 +11591,7 @@ function EditWithPaint3DContext
$Extensions = @ ( " .bmp " , " .gif " , " .jpe " , " .jpeg " , " .jpg " , " .png " , " .tif " , " .tiff " )
$Extensions = @ ( " .bmp " , " .gif " , " .jpe " , " .jpeg " , " .jpg " , " .png " , " .tif " , " .tiff " )
foreach ( $Extension in $Extensions )
foreach ( $Extension in $Extensions )
{
{
Remove-ItemProperty -Path " Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\ $ Extension\Shell\3D Edit " -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinu e
Remove-ItemProperty -Path " Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\ $ Extension\Shell\3D Edit " -Name ProgrammaticAccessOnly -Force -ErrorAction Ignor e
}
}
}
}
}
}
@ -12016,7 +12028,7 @@ function BitmapImageNewContext
{
{
if ( ( Get-WindowsCapability -Online -Name " Microsoft.Windows.MSPaint* " ) . State -eq " Installed " )
if ( ( Get-WindowsCapability -Online -Name " Microsoft.Windows.MSPaint* " ) . State -eq " Installed " )
{
{
Remove-Item -Path Registry :: HKEY_CLASSES_ROOT \ . bmp \ ShellNew -Force -ErrorAction SilentlyContinu e
Remove-Item -Path Registry :: HKEY_CLASSES_ROOT \ . bmp \ ShellNew -Force -ErrorAction Ignor e
}
}
}
}
" Show "
" Show "