|
@ -7845,7 +7845,7 @@ function WinPrtScrFolder |
|
|
.NOTES |
|
|
.NOTES |
|
|
Machine-wide |
|
|
Machine-wide |
|
|
#> |
|
|
#> |
|
|
function RecommendedTroubleshooting ### |
|
|
function RecommendedTroubleshooting |
|
|
{ |
|
|
{ |
|
|
param |
|
|
param |
|
|
( |
|
|
( |
|
@ -10183,10 +10183,10 @@ function Install-WSL |
|
|
UseBasicParsing = $true |
|
|
UseBasicParsing = $true |
|
|
Verbose = $true |
|
|
Verbose = $true |
|
|
} |
|
|
} |
|
|
$Distros = (Invoke-RestMethod @Parameters).Distributions | ForEach-Object -Process { |
|
|
$Distributions = (Invoke-RestMethod @Parameters).Distributions | ForEach-Object -Process { |
|
|
[PSCustomObject]@{ |
|
|
[PSCustomObject]@{ |
|
|
"Distro" = $_.FriendlyName |
|
|
"Distribution" = $_.FriendlyName |
|
|
"Alias" = $_.Name |
|
|
"Alias" = $_.Name |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -10269,16 +10269,16 @@ function Install-WSL |
|
|
} |
|
|
} |
|
|
#endregion |
|
|
#endregion |
|
|
|
|
|
|
|
|
foreach ($Distro in $Distros) |
|
|
foreach ($Distribution in $Distributions) |
|
|
{ |
|
|
{ |
|
|
$Panel = New-Object -TypeName System.Windows.Controls.StackPanel |
|
|
$Panel = New-Object -TypeName System.Windows.Controls.StackPanel |
|
|
$RadioButton = New-Object -TypeName System.Windows.Controls.RadioButton |
|
|
$RadioButton = New-Object -TypeName System.Windows.Controls.RadioButton |
|
|
$TextBlock = New-Object -TypeName System.Windows.Controls.TextBlock |
|
|
$TextBlock = New-Object -TypeName System.Windows.Controls.TextBlock |
|
|
$Panel.Orientation = "Horizontal" |
|
|
$Panel.Orientation = "Horizontal" |
|
|
$RadioButton.GroupName = "WslDistro" |
|
|
$RadioButton.GroupName = "WslDistribution" |
|
|
$RadioButton.Tag = $Distro.Alias |
|
|
$RadioButton.Tag = $Distribution.Alias |
|
|
$RadioButton.Add_Checked({RadioButtonChecked}) |
|
|
$RadioButton.Add_Checked({RadioButtonChecked}) |
|
|
$TextBlock.Text = $Distro.Distro |
|
|
$TextBlock.Text = $Distribution.Distribution |
|
|
$Panel.Children.Add($RadioButton) | Out-Null |
|
|
$Panel.Children.Add($RadioButton) | Out-Null |
|
|
$Panel.Children.Add($TextBlock) | Out-Null |
|
|
$Panel.Children.Add($TextBlock) | Out-Null |
|
|
$PanelContainer.Children.Add($Panel) | Out-Null |
|
|
$PanelContainer.Children.Add($Panel) | Out-Null |
|
@ -10323,7 +10323,6 @@ function Install-WSL |
|
|
Write-Warning -Message $Localization.NoInternetConnection |
|
|
Write-Warning -Message $Localization.NoInternetConnection |
|
|
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue |
|
|
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
#endregion WSL |
|
|
#endregion WSL |
|
|
|
|
|
|
|
@ -11300,31 +11299,14 @@ function CleanupTask |
|
|
{ |
|
|
{ |
|
|
"Register" |
|
|
"Register" |
|
|
{ |
|
|
{ |
|
|
# Checking if notifications and Action Center are disabled |
|
|
# Remove registry keys if notifications and Action Center are disabled |
|
|
# Due to "Set-StrictMode -Version Latest" we have to use GetValue() |
|
|
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore |
|
|
$UserNotificationCenter = [Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer", "DisableNotificationCenter", $null) |
|
|
|
|
|
$MachineNotificationCenter = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Explorer", "DisableNotificationCenter", $null) |
|
|
|
|
|
if (($UserNotificationCenter -eq 1) -or ($MachineNotificationCenter -eq 1)) |
|
|
|
|
|
{ |
|
|
|
|
|
Write-Verbose -Message ($Localization.ActionCenter -f $MyInvocation.Line.Trim()) -Verbose |
|
|
|
|
|
Write-Error -Message ($Localization.ActionCenter -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue |
|
|
|
|
|
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
# Remove registry keys if Windows Script Host is disabled |
|
|
} |
|
|
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\Software\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore |
|
|
|
|
|
|
|
|
# Checking if Windows Script Host is disabled |
|
|
# Enable notifications |
|
|
# Due to "Set-StrictMode -Version Latest" we have to use GetValue() |
|
|
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore |
|
|
$UserScriptHost = [Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings", "Enabled", $null) |
|
|
|
|
|
$MachineScriptHost = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings", "Enabled", $null) |
|
|
|
|
|
if (($UserScriptHost -eq 0) -or ($MachineScriptHost -eq 0)) |
|
|
|
|
|
{ |
|
|
|
|
|
Write-Verbose -Message ($Localization.WindowsScriptHost -f $MyInvocation.Line.Trim()) -Verbose |
|
|
|
|
|
Write-Error -Message ($Localization.WindowsScriptHost -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue |
|
|
|
|
|
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Checking if we're trying to create the task when it was already created as another user |
|
|
# Checking if we're trying to create the task when it was already created as another user |
|
|
if (Get-ScheduledTask -TaskPath "\Sophia\" -TaskName "Windows Cleanup" -ErrorAction Ignore) |
|
|
if (Get-ScheduledTask -TaskPath "\Sophia\" -TaskName "Windows Cleanup" -ErrorAction Ignore) |
|
@ -11751,18 +11733,14 @@ function SoftwareDistributionTask |
|
|
{ |
|
|
{ |
|
|
"Register" |
|
|
"Register" |
|
|
{ |
|
|
{ |
|
|
# Checking if Windows Script Host is disabled |
|
|
# Remove registry keys if notifications and Action Center are disabled |
|
|
# Due to "Set-StrictMode -Version Latest" we have to use GetValue() |
|
|
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore |
|
|
$UserScriptHost = [Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings", "Enabled", $null) |
|
|
|
|
|
$MachineScriptHost = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings", "Enabled", $null) |
|
|
|
|
|
if (($UserScriptHost -eq 0) -or ($MachineScriptHost -eq 0)) |
|
|
|
|
|
{ |
|
|
|
|
|
Write-Verbose -Message ($Localization.WindowsScriptHost -f $MyInvocation.Line.Trim()) -Verbose |
|
|
|
|
|
Write-Error -Message ($Localization.WindowsScriptHost -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue |
|
|
|
|
|
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
# Remove registry keys if Windows Script Host is disabled |
|
|
} |
|
|
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\Software\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore |
|
|
|
|
|
|
|
|
|
|
|
# Enable notifications |
|
|
|
|
|
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore |
|
|
|
|
|
|
|
|
# Checking if we're trying to create the task when it was already created as another user |
|
|
# Checking if we're trying to create the task when it was already created as another user |
|
|
if (Get-ScheduledTask -TaskPath "\Sophia\" -TaskName SoftwareDistribution -ErrorAction Ignore) |
|
|
if (Get-ScheduledTask -TaskPath "\Sophia\" -TaskName SoftwareDistribution -ErrorAction Ignore) |
|
@ -12062,18 +12040,14 @@ function TempTask |
|
|
{ |
|
|
{ |
|
|
"Register" |
|
|
"Register" |
|
|
{ |
|
|
{ |
|
|
# Checking if Windows Script Host is disabled |
|
|
# Remove registry keys if notifications and Action Center are disabled |
|
|
# Due to "Set-StrictMode -Version Latest" we have to use GetValue() |
|
|
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore |
|
|
$UserScriptHost = [Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings", "Enabled", $null) |
|
|
|
|
|
$MachineScriptHost = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings", "Enabled", $null) |
|
|
|
|
|
if (($UserScriptHost -eq 0) -or ($MachineScriptHost -eq 0)) |
|
|
|
|
|
{ |
|
|
|
|
|
Write-Verbose -Message ($Localization.WindowsScriptHost -f $MyInvocation.Line.Trim()) -Verbose |
|
|
|
|
|
Write-Error -Message ($Localization.WindowsScriptHost -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue |
|
|
|
|
|
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
# Remove registry keys if Windows Script Host is disabled |
|
|
} |
|
|
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\Software\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore |
|
|
|
|
|
|
|
|
|
|
|
# Enable notifications |
|
|
|
|
|
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore |
|
|
|
|
|
|
|
|
# Checking if we're trying to create the task when it was already created as another user |
|
|
# Checking if we're trying to create the task when it was already created as another user |
|
|
if (Get-ScheduledTask -TaskPath "\Sophia\" -TaskName Temp -ErrorAction Ignore) |
|
|
if (Get-ScheduledTask -TaskPath "\Sophia\" -TaskName Temp -ErrorAction Ignore) |
|
@ -12862,7 +12836,7 @@ function SaveZoneInformation |
|
|
.NOTES |
|
|
.NOTES |
|
|
Current user |
|
|
Current user |
|
|
#> |
|
|
#> |
|
|
function WindowsScriptHost |
|
|
function WindowsScriptHost ### |
|
|
{ |
|
|
{ |
|
|
param |
|
|
param |
|
|
( |
|
|
( |
|
@ -14092,6 +14066,12 @@ public static void PostMessage() |
|
|
|
|
|
|
|
|
#region Toast notifications |
|
|
#region Toast notifications |
|
|
# Persist Sophia notifications to prevent to immediately disappear from Action Center |
|
|
# Persist Sophia notifications to prevent to immediately disappear from Action Center |
|
|
|
|
|
# Remove registry keys if notifications and Action Center are disabled |
|
|
|
|
|
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore |
|
|
|
|
|
|
|
|
|
|
|
# Enable notifications |
|
|
|
|
|
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore |
|
|
|
|
|
|
|
|
if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia)) |
|
|
if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia)) |
|
|
{ |
|
|
{ |
|
|
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Force |
|
|
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Force |
|
|