@ -58,9 +58,10 @@ function InitialActions
[Net.ServicePointManager] :: SecurityProtocol = [Net.SecurityProtocolType] :: Tls12
[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
$Signature = @ {
$Signature = @ {
Namespace = " WinAPI "
Namespace = " WinAPI "
Name = " GetStr "
Name = " GetStrings "
Language = " CSharp "
Language = " CSharp "
UsingNamespace = " System.Text "
UsingNamespace = " System.Text "
MemberDefinition = @ "
MemberDefinition = @ "
@ -77,9 +78,38 @@ public static string GetString(uint strId)
LoadString ( intPtr , strId , sb , sb . Capacity ) ;
LoadString ( intPtr , strId , sb , sb . Capacity ) ;
return sb . ToString ( ) ;
return sb . ToString ( ) ;
}
}
/ / Get string from other DLLs
[ DllImport ( " shlwapi.dll " , CharSet = CharSet . Unicode ) ]
private static extern int SHLoadIndirectString ( string pszSource , StringBuilder pszOutBuf , int cchOutBuf , string ppvReserved ) ;
public static string GetIndirectString ( string indirectString )
{
try
{
int returnValue ;
StringBuilder lptStr = new StringBuilder ( 1024 ) ;
returnValue = SHLoadIndirectString ( indirectString , lptStr , 1024 , null ) ;
if ( returnValue = = 0 )
{
return lptStr . ToString ( ) ;
}
else
{
return null ;
/ / return " SHLoadIndirectString Failure: " + returnValue ;
}
}
catch / / ( Exception ex )
{
return null ;
/ / return " Exception Message: " + ex . Message ;
}
}
" @
" @
}
}
if ( -not ( " WinAPI.GetStr " -as [type] ) )
if ( -not ( " WinAPI.GetStrings " -as [type] ) )
{
{
Add-Type @Signature
Add-Type @Signature
}
}
@ -89,7 +119,7 @@ public static string GetString(uint strId)
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
try
try
{
{
@ -140,16 +170,7 @@ public static string GetString(uint strId)
{
{
& " $ {env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe " - -no -first -run - -noerrdialogs - -no -default -browser -check - -start -maximized
& " $ {env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe " - -no -first -run - -noerrdialogs - -no -default -browser -check - -start -maximized
}
}
catch [System.InvalidOperationException]
catch
{
Write-Warning -Message ( $Localization . WindowsComponentBroken -f " Microsoft Edge " )
Start-Process -FilePath " https://t.me/sophia_chat "
Start-Process -FilePath " https://discord.gg/sSryhaEv79 "
exit
}
catch [System.Management.Automation.ApplicationFailedException]
{
{
Write-Warning -Message ( $Localization . WindowsComponentBroken -f " Microsoft Edge " )
Write-Warning -Message ( $Localization . WindowsComponentBroken -f " Microsoft Edge " )
@ -329,7 +350,7 @@ public static string GetString(uint strId)
if ( ( Get-Service -Name EventLog ) . Status -eq " Stopped " )
if ( ( Get-Service -Name EventLog ) . Status -eq " Stopped " )
{
{
# Extract the localized "Event Viewer" string from shell32.dll
# Extract the localized "Event Viewer" string from shell32.dll
Write-Warning -Message ( $Localization . WindowsComponentBroken -f $ ( [WinAPI.GetStr] :: GetString ( 22029 ) ) )
Write-Warning -Message ( $Localization . WindowsComponentBroken -f $ ( [WinAPI.GetStrings ] :: GetString ( 22029 ) ) )
Start-Process -FilePath " https://t.me/sophia_chat "
Start-Process -FilePath " https://t.me/sophia_chat "
Start-Process -FilePath " https://discord.gg/sSryhaEv79 "
Start-Process -FilePath " https://discord.gg/sSryhaEv79 "
@ -412,6 +433,7 @@ public static string GetString(uint strId)
try
try
{
{
$Services = Get-Service -Name Windefend , SecurityHealthService , wscsvc -ErrorAction Stop
$Services = Get-Service -Name Windefend , SecurityHealthService , wscsvc -ErrorAction Stop
Get-Service -Name SecurityHealthService -ErrorAction Stop | Start-Service
}
}
catch [Microsoft.PowerShell.Commands.ServiceCommandException]
catch [Microsoft.PowerShell.Commands.ServiceCommandException]
{
{
@ -662,7 +684,7 @@ public static string GetString(uint strId)
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Remove IP addresses from hosts file that block Microsoft recourses added by WindowsSpyBlocker
# Remove IP addresses from hosts file that block Microsoft recourses added by WindowsSpyBlocker
@ -752,7 +774,7 @@ public static string GetString(uint strId)
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Check whether hosts contains any of string from $IPArray array
# Check whether hosts contains any of string from $IPArray array
@ -792,6 +814,33 @@ public static string GetString(uint strId)
Write-Error -Message ( $Localization . RestartFunction -f $MyInvocation . Line . Trim ( ) ) -ErrorAction SilentlyContinue
Write-Error -Message ( $Localization . RestartFunction -f $MyInvocation . Line . Trim ( ) ) -ErrorAction SilentlyContinue
}
}
# Register a temp schedule task to check whether there's a Windows bug presented
$Action = New-ScheduledTaskAction -Execute powershell . exe
$Settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable
$Principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -RunLevel Highest
$Parameters = @ {
TaskName = " SophiaTest "
Principal = $Principal
Action = $Action
Settings = $Settings
}
try
{
Register-ScheduledTask @Parameters -Force -ErrorAction Stop
}
catch [Microsoft.Management.Infrastructure.CimException]
{
Write-Verbose -Message ( $Localization . WindowsComponentBroken -f [WinAPI.GetStrings] :: GetIndirectString ( " @%SystemRoot%\system32\schedsvc.dll,-100 " ) ) -Verbose
Start-Process -FilePath " https://github.com/farag2/Sophia-Script-for-Windows/releases/latest "
Start-Process -FilePath " https://t.me/sophia_chat "
Start-Process -FilePath " https://discord.gg/sSryhaEv79 "
exit
}
Unregister-ScheduledTask -TaskName SophiaTest -Confirm : $false -ErrorAction Ignore
# PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word
# PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word
Get-ChildItem -Path " $ env:TEMP\Computer.txt " , " $ env:TEMP\User.txt " -Force -ErrorAction Ignore | Remove-Item -Recurse -Force -ErrorAction Ignore
Get-ChildItem -Path " $ env:TEMP\Computer.txt " , " $ env:TEMP\User.txt " -Force -ErrorAction Ignore | Remove-Item -Recurse -Force -ErrorAction Ignore
@ -843,7 +892,7 @@ public static string GetString(uint strId)
if ( $AddSkip )
if ( $AddSkip )
{
{
# Extract the localized "Skip" string from shell32.dll
# Extract the localized "Skip" string from shell32.dll
$Menu + = [WinAPI.GetStr] :: GetString ( 16956 )
$Menu + = [WinAPI.GetStrings ] :: GetString ( 16956 )
}
}
# https://github.com/microsoft/terminal/issues/14992
# https://github.com/microsoft/terminal/issues/14992
@ -898,14 +947,14 @@ public static string GetString(uint strId)
}
}
# Extract the localized "Browse" string from shell32.dll
# Extract the localized "Browse" string from shell32.dll
$Script:Browse = [WinAPI.GetStr] :: GetString ( 9015 )
$Script:Browse = [WinAPI.GetStrings ] :: GetString ( 9015 )
# Extract the localized "&No" string from shell32.dll
# Extract the localized "&No" string from shell32.dll
$Script:No = [WinAPI.GetStr] :: GetString ( 33232 ) . Replace ( " & " , " " )
$Script:No = [WinAPI.GetStrings ] :: GetString ( 33232 ) . Replace ( " & " , " " )
# Extract the localized "&Yes" string from shell32.dll
# Extract the localized "&Yes" string from shell32.dll
$Script:Yes = [WinAPI.GetStr] :: GetString ( 33224 ) . Replace ( " & " , " " )
$Script:Yes = [WinAPI.GetStrings ] :: GetString ( 33224 ) . Replace ( " & " , " " )
$Script:KeyboardArrows = $Localization . KeyboardArrows -f [System.Char] :: ConvertFromUtf32 ( 0x2191 ) , [System.Char] :: ConvertFromUtf32 ( 0x2193 )
$Script:KeyboardArrows = $Localization . KeyboardArrows -f [System.Char] :: ConvertFromUtf32 ( 0x2191 ) , [System.Char] :: ConvertFromUtf32 ( 0x2193 )
# Extract the localized "Skip" string from shell32.dll
# Extract the localized "Skip" string from shell32.dll
$Script:Skip = [WinAPI.GetStr] :: GetString ( 16956 )
$Script:Skip = [WinAPI.GetStrings ] :: GetString ( 16956 )
# 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 )
@ -1127,7 +1176,7 @@ function DiagTrackService
)
)
# Check whether "InitialActions" function was removed in preset file
# Check whether "InitialActions" function was removed in preset file
if ( -not ( " WinAPI.GetStr " -as [type] ) )
if ( -not ( " WinAPI.GetStrings " -as [type] ) )
{
{
# Get the name of a preset (e.g Sophia.ps1) regardless it was named
# Get the name of a preset (e.g Sophia.ps1) regardless it was named
# $_.File has no EndsWith() method
# $_.File has no EndsWith() method
@ -1550,7 +1599,7 @@ function ScheduledTasks
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
[void] $Window . Close ( )
[void] $Window . Close ( )
@ -1562,7 +1611,7 @@ function ScheduledTasks
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
[void] $Window . Close ( )
[void] $Window . Close ( )
@ -1615,7 +1664,7 @@ function ScheduledTasks
{
{
$State = " Disabled "
$State = " Disabled "
# Extract the localized "Enable" string from shell32.dll
# Extract the localized "Enable" string from shell32.dll
$ButtonContent = [WinAPI.GetStr] :: GetString ( 51472 )
$ButtonContent = [WinAPI.GetStrings ] :: GetString ( 51472 )
$ButtonAdd_Click = { EnableButton }
$ButtonAdd_Click = { EnableButton }
}
}
" Disable "
" Disable "
@ -1628,7 +1677,7 @@ function ScheduledTasks
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
# Getting list of all scheduled tasks according to the conditions
# Getting list of all scheduled tasks according to the conditions
$Tasks = Get-ScheduledTask | Where-Object -FilterScript { ( $_ . State -eq $State ) -and ( $_ . TaskName -in $CheckedScheduledTasks ) }
$Tasks = Get-ScheduledTask | Where-Object -FilterScript { ( $_ . State -eq $State ) -and ( $_ . TaskName -in $CheckedScheduledTasks ) }
@ -3554,7 +3603,7 @@ function UnpinTaskbarShortcuts
)
)
# Extract the localized "Unpin from taskbar" string from shell32.dll
# Extract the localized "Unpin from taskbar" string from shell32.dll
$LocalizedString = [WinAPI.GetStr] :: GetString ( 5387 )
$LocalizedString = [WinAPI.GetStrings ] :: GetString ( 5387 )
foreach ( $Shortcut in $Shortcuts )
foreach ( $Shortcut in $Shortcuts )
{
{
@ -3568,7 +3617,7 @@ 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.GetStr] :: GetString ( 5387 ) ) " } | ForEach-Object -Process { $_ . DoIt ( ) }
$Shortcut . Verbs ( ) | Where-Object -FilterScript { $_ . Name -eq " $( [WinAPI.GetStrings ] :: GetString ( 5387 ) ) " } | ForEach-Object -Process { $_ . DoIt ( ) }
}
}
}
}
Store
Store
@ -5843,7 +5892,7 @@ function WindowsFeatures
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
[void] $Window . Close ( )
[void] $Window . Close ( )
@ -5855,7 +5904,7 @@ function WindowsFeatures
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
[void] $Window . Close ( )
[void] $Window . Close ( )
@ -5925,7 +5974,7 @@ function WindowsFeatures
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
# Getting list of all optional features according to the conditions
# Getting list of all optional features according to the conditions
$OFS = " | "
$OFS = " | "
@ -6198,7 +6247,7 @@ function WindowsCapabilities
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
[void] $Window . Close ( )
[void] $Window . Close ( )
@ -6216,7 +6265,7 @@ function WindowsCapabilities
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
[void] $Window . Close ( )
[void] $Window . Close ( )
@ -6315,7 +6364,7 @@ function WindowsCapabilities
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
# Getting list of all capabilities according to the conditions
# Getting list of all capabilities according to the conditions
$OFS = " | "
$OFS = " | "
@ -6742,7 +6791,7 @@ function NetworkAdaptersSavePower
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
if ( Get-NetAdapter -Physical | Where-Object -FilterScript { ( $_ . Status -eq " Up " ) -and $_ . MacAddress } )
if ( Get-NetAdapter -Physical | Where-Object -FilterScript { ( $_ . Status -eq " Up " ) -and $_ . MacAddress } )
{
{
@ -6782,7 +6831,7 @@ function NetworkAdaptersSavePower
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
Start-Sleep -Seconds 2
Start-Sleep -Seconds 2
}
}
@ -6845,7 +6894,7 @@ function IPv6Component
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
try
try
{
{
@ -7212,10 +7261,10 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Desktop
# Desktop
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . DriveSelect -f [WinAPI.GetStr] :: GetString ( 21769 ) ) -Verbose
Write-Verbose -Message ( $Localization . DriveSelect -f [WinAPI.GetStrings ] :: GetString ( 21769 ) ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Desktop
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Desktop
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21769 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21769 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7240,10 +7289,10 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Documents
# Documents
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . DriveSelect -f [WinAPI.GetStr] :: GetString ( 21770 ) ) -Verbose
Write-Verbose -Message ( $Localization . DriveSelect -f [WinAPI.GetStrings ] :: GetString ( 21770 ) ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Personal
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Personal
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21770 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21770 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7268,10 +7317,10 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Downloads
# Downloads
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . DriveSelect -f [WinAPI.GetStr] :: GetString ( 21798 ) ) -Verbose
Write-Verbose -Message ( $Localization . DriveSelect -f [WinAPI.GetStrings ] :: GetString ( 21798 ) ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21798 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21798 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7296,10 +7345,10 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Music
# Music
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . DriveSelect -f [WinAPI.GetStr] :: GetString ( 21790 ) ) -Verbose
Write-Verbose -Message ( $Localization . DriveSelect -f [WinAPI.GetStrings ] :: GetString ( 21790 ) ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Music "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Music "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21790 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21790 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7324,10 +7373,10 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Pictures
# Pictures
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . DriveSelect -f [WinAPI.GetStr] :: GetString ( 21779 ) ) -Verbose
Write-Verbose -Message ( $Localization . DriveSelect -f [WinAPI.GetStrings ] :: GetString ( 21779 ) ) -Verbose
$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 [WinAPI.GetStr] :: GetString ( 21779 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21779 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7352,10 +7401,10 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Videos
# Videos
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . DriveSelect -f [WinAPI.GetStr] :: GetString ( 21791 ) ) -Verbose
Write-Verbose -Message ( $Localization . DriveSelect -f [WinAPI.GetStrings ] :: GetString ( 21791 ) ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Video "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Video "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21791 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21791 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7382,10 +7431,10 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
{
{
# Desktop
# Desktop
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . UserFolderRequest -f [WinAPI.GetStr] :: GetString ( 21769 ) ) -Verbose
Write-Verbose -Message ( $Localization . UserFolderRequest -f [WinAPI.GetStrings ] :: GetString ( 21769 ) ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Desktop
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Desktop
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21769 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21769 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7422,10 +7471,10 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Documents
# Documents
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . UserFolderRequest -f [WinAPI.GetStr] :: GetString ( 21770 ) ) -Verbose
Write-Verbose -Message ( $Localization . UserFolderRequest -f [WinAPI.GetStrings ] :: GetString ( 21770 ) ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Personal
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Personal
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21770 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21770 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7462,10 +7511,10 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Downloads
# Downloads
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . UserFolderRequest -f [WinAPI.GetStr] :: GetString ( 21798 ) ) -Verbose
Write-Verbose -Message ( $Localization . UserFolderRequest -f [WinAPI.GetStrings ] :: GetString ( 21798 ) ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21798 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21798 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7502,10 +7551,10 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Music
# Music
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . UserFolderRequest -f [WinAPI.GetStr] :: GetString ( 21790 ) ) -Verbose
Write-Verbose -Message ( $Localization . UserFolderRequest -f [WinAPI.GetStrings ] :: GetString ( 21790 ) ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Music "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Music "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21790 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21790 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7542,10 +7591,10 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Pictures
# Pictures
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . UserFolderRequest -f [WinAPI.GetStr] :: GetString ( 21779 ) ) -Verbose
Write-Verbose -Message ( $Localization . UserFolderRequest -f [WinAPI.GetStrings ] :: GetString ( 21779 ) ) -Verbose
$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 [WinAPI.GetStr] :: GetString ( 21779 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21779 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7582,10 +7631,10 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Videos
# Videos
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . UserFolderRequest -f [WinAPI.GetStr] :: GetString ( 21791 ) ) -Verbose
Write-Verbose -Message ( $Localization . UserFolderRequest -f [WinAPI.GetStrings ] :: GetString ( 21791 ) ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Video "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Video "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21791 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21791 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7624,11 +7673,11 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
{
{
# Desktop
# Desktop
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . UserDefaultFolder -f [WinAPI.GetStr] :: GetString ( 21769 ) ) -Verbose
Write-Verbose -Message ( $Localization . UserDefaultFolder -f [WinAPI.GetStrings ] :: GetString ( 21769 ) ) -Verbose
# Extract the localized "Desktop" string from shell32.dll
# Extract the localized "Desktop" string from shell32.dll
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Desktop
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Desktop
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21769 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21769 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7653,11 +7702,11 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Documents
# Documents
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . UserDefaultFolder -f [WinAPI.GetStr] :: GetString ( 21770 ) ) -Verbose
Write-Verbose -Message ( $Localization . UserDefaultFolder -f [WinAPI.GetStrings ] :: GetString ( 21770 ) ) -Verbose
# Extract the localized "Documents" string from shell32.dll
# Extract the localized "Documents" string from shell32.dll
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Personal
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Personal
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21770 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21770 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7682,11 +7731,11 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Downloads
# Downloads
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . UserDefaultFolder -f [WinAPI.GetStr] :: GetString ( 21798 ) ) -Verbose
Write-Verbose -Message ( $Localization . UserDefaultFolder -f [WinAPI.GetStrings ] :: GetString ( 21798 ) ) -Verbose
# Extract the localized "Downloads" string from shell32.dll
# Extract the localized "Downloads" string from shell32.dll
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21798 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21798 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7711,11 +7760,11 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Music
# Music
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . UserDefaultFolder -f [WinAPI.GetStr] :: GetString ( 21790 ) ) -Verbose
Write-Verbose -Message ( $Localization . UserDefaultFolder -f [WinAPI.GetStrings ] :: GetString ( 21790 ) ) -Verbose
# Extract the localized "Music" string from shell32.dll
# Extract the localized "Music" string from shell32.dll
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Music "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Music "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21790 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21790 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7740,11 +7789,11 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Pictures
# Pictures
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . UserDefaultFolder -f [WinAPI.GetStr] :: GetString ( 21779 ) ) -Verbose
Write-Verbose -Message ( $Localization . UserDefaultFolder -f [WinAPI.GetStrings ] :: GetString ( 21779 ) ) -Verbose
# Extract the localized "Pictures" string from shell32.dll
# Extract the localized "Pictures" string from shell32.dll
$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 [WinAPI.GetStr] :: GetString ( 21779 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21779 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -7769,11 +7818,11 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Videos
# Videos
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . UserDefaultFolder -f [WinAPI.GetStr] :: GetString ( 21791 ) ) -Verbose
Write-Verbose -Message ( $Localization . UserDefaultFolder -f [WinAPI.GetStrings ] :: GetString ( 21791 ) ) -Verbose
# Extract the localized "Pictures" string from shell32.dll
# Extract the localized "Pictures" string from shell32.dll
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Video "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Video "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStr] :: GetString ( 21791 ) , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f [WinAPI.GetStrings ] :: GetString ( 21791 ) , $CurrentUserFolderLocation ) -Verbose
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
do
do
@ -9346,7 +9395,7 @@ public static long MakeLong(uint left, uint right)
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
# Register %1 argument if ProgId exists as an executable file
# Register %1 argument if ProgId exists as an executable file
if ( Test-Path -Path $ProgramPath )
if ( Test-Path -Path $ProgramPath )
@ -10733,14 +10782,14 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
#>
#>
function UnpinAllStartApps
function UnpinAllStartApps
{
{
Remove-Item "$ env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start*.bin " -Force -ErrorAction Ignore
Remove-Item -Path "$ env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start*.bin " -Force -ErrorAction Ignore
# https://gist.github.com/rad1ke
# https://gist.github.com/rad1ke
$HexString = " E27AE14B01FC4D1B9C00810BDE6E51854E5A5F47005BB1498A5C92AF9084F95E9BDB91E2EEDDD701300B000067DEFA31529529B3D32D8092A6EB66C8D5EADB19CF9B13518AAB9
$HexString = " E27AE14B01FC4D1B9C00810BDE6E51854E5A5F47005BB1498A5C92AF9084F95E9BDB91E2EEDDD701300B000067DEFA31529529B3D32D8092A6EB66C8D5EADB19CF9B13518AAB9
3275D9CEEF37E62C3574C036F327D1110AB0977996D67A2F8FA897D7207BEE85586B8CE6AD4F9736AA2154E3DCC9D082996984B76F1C73067F124F92A41F2B2CA83EF35436670979556FAE85AB10EA1
3275D9CEEF37E62C3574C036F327D1110AB0977996D67A2F8FA897D7207BEE85586B8CE6AD4F9736AA2154E3DCC9D082996984B76F1C73067F124F92A41F2B2CA83EF35436670979556FAE85AB10EA1
6C932C3AECE1D45DA06D64BC42F4565AD0FCB8C63CDE7F6BB97ACE300198C3EACA3E1C974F547B1A7CF5B9C6A912448AB38A3BE2D6F0230A4A9AACC710C3E75088754CC2FB054B55B1D6ED7AD41EB8B
6C932C3AECE1D45DA06D64BC42F4565AD0FCB8C63CDE7F6BB97ACE300198C3EACA3E1C974F547B1A7CF5B9C6A912448AB38A3BE2D6F0230A4A9AACC710C3E75088754CC2FB054B55B1D6ED7AD41EB8B
0C9D4C274E87A525582F6CFBEAE5A904A1B0A3BA07939B79CAB4F1C3DF35BF88DE846E64555F0AEB47562C329206A9975664558849E0C251E8832D52B4FD7560347E5606AC882B9FC1F43C96922C0EA
0C9D4C274E87A525582F6CFBEAE5A904A1B0A3BA07939B79CAB4F1C3DF35BF88DE846E64555F0AEB47562C329206A9975664558849E0C251E8832D52B4FD7560347E5606AC882B9FC1F43C96922C0EA
1927DF004A062BAD5AC5A4BE6BF2DB23158B2BAEEF8DE9E3A777910E82E5488A83E4D64B0D84440B98B35BC4A3438596145669904AB392CFD5F7E22F616747B85206 481FE1FF41CA9A2534CCE7AFC45
1927DF004A062BAD5AC5A4BE6BF2DB23158B2BAEEF8DE9E3A777910E82E5488A83E4D64B0D84440B98B35BC4A3438596145669904AB392CFD5F7E22F616747B84851 481FE1FF41CA9A2534CCE7AFC45
584370B4940DF30555536344249690F00C3A7E2552E352FE733C7ED2F80A29AD16937810AF805A444A344188C0CBDA51E5466BF45F2587508A69581CC2BCDAE06CB363658D94CD60569352FDA17AE7C
584370B4940DF30555536344249690F00C3A7E2552E352FE733C7ED2F80A29AD16937810AF805A444A344188C0CBDA51E5466BF45F2587508A69581CC2BCDAE06CB363658D94CD60569352FDA17AE7C
DD785810F369B41F2D15930430A809567CC6C643FE7986CAD545EF3DB40CA6FA9220BFC7F65610AECB22799838B80DE73AF549923F8219FFAAD64780E2DB53133D73890294E77F9B0970484E86A0507
DD785810F369B41F2D15930430A809567CC6C643FE7986CAD545EF3DB40CA6FA9220BFC7F65610AECB22799838B80DE73AF549923F8219FFAAD64780E2DB53133D73890294E77F9B0970484E86A0507
37724FF15281C1726D334D3C9A67A85A78AE33F55DB675DAA31C47A156C0F8212DCEE228537668F4BF898C0CB869B74C98DF7EFBE0130859E5156417A85CC634B86314FAB47FB9A8DFEAFA1AEFC5E59
37724FF15281C1726D334D3C9A67A85A78AE33F55DB675DAA31C47A156C0F8212DCEE228537668F4BF898C0CB869B74C98DF7EFBE0130859E5156417A85CC634B86314FAB47FB9A8DFEAFA1AEFC5E59
@ -10768,7 +10817,7 @@ FEA494190BF3446DCC8C8AAF62BA01F0BFB18E15503C27558DB70C48EFB0AEA0B600F985C904E9F2
2EEEF7B09850D29B2F412DEF3D0BD9194CAE8113B3B38085C77C238CB8D15BF6D6AB42C193F4E2F27F8BEDABB2D6ADE9E486B6AFAFD8D5DBE3B7D7305790F96ECDCC2DD016C5B9B200CB72E6CF54D71
2EEEF7B09850D29B2F412DEF3D0BD9194CAE8113B3B38085C77C238CB8D15BF6D6AB42C193F4E2F27F8BEDABB2D6ADE9E486B6AFAFD8D5DBE3B7D7305790F96ECDCC2DD016C5B9B200CB72E6CF54D71
F69A01CDE4E3A0A4C5A03627DECD491F215C1420EB07AB8FD2763FCFF5211EB964C82E69DA208BDFA76306D54642B117DCB9A92927CE2E633338D4EEA63B571349B8DA1D4B5523C4CA10308769E4F46
F69A01CDE4E3A0A4C5A03627DECD491F215C1420EB07AB8FD2763FCFF5211EB964C82E69DA208BDFA76306D54642B117DCB9A92927CE2E633338D4EEA63B571349B8DA1D4B5523C4CA10308769E4F46
1ADD16DD5DFDB0E705187593DEF5CCCF659E48366462CC21D7930E1064234157A7A08E9C90927A37C5CF23D54C755002E4E657BB6E70D9B4BE7C468C19D6969FAE138EBF2C20DD3F5A0BC4C0E97D5BF
1ADD16DD5DFDB0E705187593DEF5CCCF659E48366462CC21D7930E1064234157A7A08E9C90927A37C5CF23D54C755002E4E657BB6E70D9B4BE7C468C19D6969FAE138EBF2C20DD3F5A0BC4C0E97D5BF
DB8744A21396C445493085 17BEAD5AE14FF602E69E75B87784DE5F30BE14106E8D8A081DC8CCCFBF93896E622F755F27E82A596DDCA3469A93ECB9E2E897BF0FCC063426DACDC3B1D81E1EFE6B63932
DB8744A21396C445492428 17BEAD5AE14FF602E69E75B87784DE5F30BE14106E8D8A081DC8CCCFBF93896E622F755F27E82A596DDCA3469A93ECB9E2E897BF0FCC063426DACDC3B1D81E1EFE6B63932
6CA43526CFAEDF9922EAC3204FEB84AAED781EE5516FA5B4DCAB85DB5FF33CEC454DAA375BDA5EEA7C871C310AEDC5BD6B220B59B901D377E22FFFE95FEDA28CE2CE33CAEB8541EE05E1B5650D776C4
6CA43526CFAEDF9922EAC3204FEB84AAED781EE5516FA5B4DCAB85DB5FF33CEC454DAA375BDA5EEA7C871C310AEDC5BD6B220B59B901D377E22FFFE95FEDA28CE2CE33CAEB8541EE05E1B5650D776C4
B2A246DB4613E2CC5D96A44D24AE662D848A7C9E3E922AFF0632B7B40505402956FABC5C3AAB55EEE29085046C127E8776CEFC1690B76EE99371AF9B1D7EF6F79E78325DD3BD8377E9B73B936C6F261
B2A246DB4613E2CC5D96A44D24AE662D848A7C9E3E922AFF0632B7B40505402956FABC5C3AAB55EEE29085046C127E8776CEFC1690B76EE99371AF9B1D7EF6F79E78325DD3BD8377E9B73B936C6F261
1D0A1223A4D7C6CF3037922DD0686A701FF86761993F294D26E13A7BB8B1C61ACAF38D50334A88DABB3FA412B4FC79F6FBFD0D0A92301484FF1BD1CF3DC67780E4562E05CCA329CABA7CB2B77D9A707
1D0A1223A4D7C6CF3037922DD0686A701FF86761993F294D26E13A7BB8B1C61ACAF38D50334A88DABB3FA412B4FC79F6FBFD0D0A92301484FF1BD1CF3DC67780E4562E05CCA329CABA7CB2B77D9A707
@ -10777,17 +10826,15 @@ BDEE24B1E5E4ED6CC9D5A337908BE5303E477736C8A75051A8FBD4E3CB6360D8F0A992A48F333434
$HexString = $HexString . Replace ( " `n " , " " ) . Replace ( " `r " , " " )
$HexString = $HexString . Replace ( " `n " , " " ) . Replace ( " `r " , " " )
$Bytes = [byte[]] :: new ( $HexString . Length / 2 )
$Bytes = [byte[]] :: new ( $HexString . Length / 2 )
for
for ( $i = 0 ; $i -lt $HexString . Length ; $i + = 2 )
(
{
$i = 0
$Bytes [ $i / 2 ] = [System.Convert] :: ToByte ( $HexString . Substring ( $i , 2 ) , 16 )
$i -lt $HexString . Length
}
$i + = 2
)
{
{
$Bytes [ $i / 2 ] = [System.Convert] :: ToByte ( $HexString . Substring ( $i , 2 ) , 16 )
$Bytes [ $i / 2 ] = [System.Convert] :: ToByte ( $HexString . Substring ( $i , 2 ) , 16 )
}
}
Set-Content -Path " $ env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin " -Value $Bytes -AsByteStream -Force
Set-Content -Path " $ env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin " -Value $Bytes -Encoding Byte -Force
}
}
<#
<#
@ -11090,7 +11137,7 @@ function UninstallUWPApps
$ButtonUninstall . Content = $Localization . Uninstall
$ButtonUninstall . Content = $Localization . Uninstall
$TextBlockRemoveForAll . Text = $Localization . UninstallUWPForAll
$TextBlockRemoveForAll . Text = $Localization . UninstallUWPForAll
# Extract the localized "Select all" string from shell32.dll
# Extract the localized "Select all" string from shell32.dll
$TextBlockSelectAll . Text = [WinAPI.GetStr] :: GetString ( 31276 )
$TextBlockSelectAll . Text = [WinAPI.GetStrings ] :: GetString ( 31276 )
$ButtonUninstall . Add_Click ( { ButtonUninstallClick } )
$ButtonUninstall . Add_Click ( { ButtonUninstallClick } )
$CheckBoxForAllUsers . Add_Click ( { CheckBoxForAllUsersClick } )
$CheckBoxForAllUsers . Add_Click ( { CheckBoxForAllUsersClick } )
@ -11112,7 +11159,7 @@ function UninstallUWPApps
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -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 } )
@ -11223,7 +11270,7 @@ function UninstallUWPApps
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
$Window . Close ( ) | Out-Null
$Window . Close ( ) | Out-Null
@ -11474,7 +11521,7 @@ function RestoreUWPApps
$Window . Title = $Localization . UWPAppsTitle
$Window . Title = $Localization . UWPAppsTitle
$ButtonRestore . Content = $Localization . Restore
$ButtonRestore . Content = $Localization . Restore
# Extract the localized "Select all" string from shell32.dll
# Extract the localized "Select all" string from shell32.dll
$TextBlockSelectAll . Text = [WinAPI.GetStr] :: GetString ( 31276 )
$TextBlockSelectAll . Text = [WinAPI.GetStrings ] :: GetString ( 31276 )
$ButtonRestore . Add_Click ( { ButtonRestoreClick } )
$ButtonRestore . Add_Click ( { ButtonRestoreClick } )
$CheckBoxSelectAll . Add_Click ( { CheckBoxSelectAllClick } )
$CheckBoxSelectAll . Add_Click ( { CheckBoxSelectAllClick } )
@ -11485,7 +11532,7 @@ function RestoreUWPApps
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -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
$Bundles = ( Get-AppXPackage -PackageTypeFilter Bundle -AllUsers ) . Name
$Bundles = ( Get-AppXPackage -PackageTypeFilter Bundle -AllUsers ) . Name
@ -11567,7 +11614,7 @@ function RestoreUWPApps
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
$Window . Close ( ) | Out-Null
$Window . Close ( ) | Out-Null
@ -12424,7 +12471,7 @@ while ([WinAPI.Focus]::GetFocusAssistState() -ne "OFF")
< / visual >
< / visual >
< audio src = " ms-winsoundevent:notification.default " / >
< audio src = " ms-winsoundevent:notification.default " / >
< actions >
< actions >
< action content = " $( [WinAPI.GetStr] :: GetString ( 12850 ) ) " arguments = " WindowsCleanup: " activationType = " protocol " / >
< action content = " $( [WinAPI.GetStrings ] :: GetString ( 12850 ) ) " arguments = " WindowsCleanup: " activationType = " protocol " / >
< action content = " " arguments = " dismiss " activationType = " system " / >
< action content = " " arguments = " dismiss " activationType = " system " / >
< / actions >
< / actions >
< / toast >
< / toast >
@ -15002,7 +15049,7 @@ function UpdateLGPEPolicies
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message $Localization . GPOUpdate -Verbose
Write-Verbose -Message $Localization . GPOUpdate -Verbose
Write-Verbose -Message HKLM -Verbose
Write-Verbose -Message HKLM -Verbose
@ -15289,7 +15336,7 @@ public static void PostMessage()
< / visual >
< / visual >
< audio src = " ms-winsoundevent:notification.default " / >
< audio src = " ms-winsoundevent:notification.default " / >
< actions >
< actions >
< action arguments = " https://t.me/sophia_chat " content = " $( [WinAPI.GetStr] :: GetString ( 12850 ) ) " activationType = " protocol " / >
< action arguments = " https://t.me/sophia_chat " content = " $( [WinAPI.GetStrings ] :: GetString ( 12850 ) ) " activationType = " protocol " / >
< action arguments = " dismiss " content = " " activationType = " system " / >
< action arguments = " dismiss " content = " " activationType = " system " / >
< / actions >
< / actions >
< / toast >
< / toast >
@ -15317,7 +15364,7 @@ public static void PostMessage()
< / visual >
< / visual >
< audio src = " ms-winsoundevent:notification.default " / >
< audio src = " ms-winsoundevent:notification.default " / >
< actions >
< actions >
< action arguments = " https://t.me/sophianews " content = " $( [WinAPI.GetStr] :: GetString ( 12850 ) ) " activationType = " protocol " / >
< action arguments = " https://t.me/sophianews " content = " $( [WinAPI.GetStrings ] :: GetString ( 12850 ) ) " activationType = " protocol " / >
< action arguments = " dismiss " content = " " activationType = " system " / >
< action arguments = " dismiss " content = " " activationType = " system " / >
< / actions >
< / actions >
< / toast >
< / toast >
@ -15345,7 +15392,7 @@ public static void PostMessage()
< / visual >
< / visual >
< audio src = " ms-winsoundevent:notification.default " / >
< audio src = " ms-winsoundevent:notification.default " / >
< actions >
< actions >
< action arguments = " https://discord.gg/sSryhaEv79 " content = " $( [WinAPI.GetStr] :: GetString ( 12850 ) ) " activationType = " protocol " / >
< action arguments = " https://discord.gg/sSryhaEv79 " content = " $( [WinAPI.GetStrings ] :: GetString ( 12850 ) ) " activationType = " protocol " / >
< action arguments = " dismiss " content = " " activationType = " system " / >
< action arguments = " dismiss " content = " " activationType = " system " / >
< / actions >
< / actions >
< / toast >
< / toast >
@ -15361,7 +15408,7 @@ public static void PostMessage()
# Check for UWP apps updates
# Check for UWP apps updates
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
# Extract the localized "Please wait..." string from shell32.dll
Write-Verbose -Message ( [WinAPI.GetStr] :: GetString ( 12612 ) ) -Verbose
Write-Verbose -Message ( [WinAPI.GetStrings ] :: GetString ( 12612 ) ) -Verbose
Get-CimInstance -Namespace root / CIMV2 / mdm / dmmap -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 | Invoke-CimMethod -MethodName UpdateScanMethod
Get-CimInstance -Namespace root / CIMV2 / mdm / dmmap -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 | Invoke-CimMethod -MethodName UpdateScanMethod
}
}
@ -15382,7 +15429,7 @@ function Errors
[PSCustomObject] @ {
[PSCustomObject] @ {
$Localization . ErrorsLine = $_ . InvocationInfo . ScriptLineNumber
$Localization . ErrorsLine = $_ . InvocationInfo . ScriptLineNumber
# Extract the localized "File" string from shell32.dll
# Extract the localized "File" string from shell32.dll
" $( [WinAPI.GetStr] :: GetString ( 4130 ) ) " = $ErrorInFile
" $( [WinAPI.GetStrings ] :: GetString ( 4130 ) ) " = $ErrorInFile
$Localization . ErrorsMessage = $_ . Exception . Message
$Localization . ErrorsMessage = $_ . Exception . Message
}
}
} | Sort-Object -Property $Localization . ErrorsLine | Format-Table -AutoSize -Wrap | Out-String ) . Trim ( )
} | Sort-Object -Property $Localization . ErrorsLine | Format-Table -AutoSize -Wrap | Out-String ) . Trim ( )