|
|
@ -769,6 +769,11 @@ function DiagnosticDataLevel |
|
|
|
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 1 -Force |
|
|
|
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DWORD -Value 1 |
|
|
|
} |
|
|
|
|
|
|
|
if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack)) |
|
|
|
{ |
|
|
|
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Force |
|
|
|
} |
|
|
|
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name MaxTelemetryAllowed -PropertyType DWord -Value 1 -Force |
|
|
|
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Name ShowedToastAtLevel -PropertyType DWord -Value 1 -Force |
|
|
|
} |
|
|
@ -777,6 +782,11 @@ function DiagnosticDataLevel |
|
|
|
# Optional diagnostic data |
|
|
|
Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Force -ErrorAction Ignore |
|
|
|
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type CLEAR |
|
|
|
|
|
|
|
if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack)) |
|
|
|
{ |
|
|
|
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Force |
|
|
|
} |
|
|
|
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name MaxTelemetryAllowed -PropertyType DWord -Value 3 -Force |
|
|
|
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Name ShowedToastAtLevel -PropertyType DWord -Value 3 -Force |
|
|
|
} |
|
|
@ -5738,59 +5748,6 @@ function PowerPlan |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
<# |
|
|
|
.SYNOPSIS |
|
|
|
The the latest installed .NET runtime for all apps usage |
|
|
|
|
|
|
|
.PARAMETER Enable |
|
|
|
Use the latest installed .NET runtime for all apps |
|
|
|
|
|
|
|
.PARAMETER Disable |
|
|
|
Do not use the latest installed .NET runtime for all apps |
|
|
|
|
|
|
|
.EXAMPLE |
|
|
|
LatestInstalled.NET -Enable |
|
|
|
|
|
|
|
.EXAMPLE |
|
|
|
LatestInstalled.NET -Disable |
|
|
|
|
|
|
|
.NOTES |
|
|
|
Machine-wide |
|
|
|
#> |
|
|
|
function LatestInstalled.NET |
|
|
|
{ |
|
|
|
param |
|
|
|
( |
|
|
|
[Parameter( |
|
|
|
Mandatory = $true, |
|
|
|
ParameterSetName = "Enable" |
|
|
|
)] |
|
|
|
[switch] |
|
|
|
$Enable, |
|
|
|
|
|
|
|
[Parameter( |
|
|
|
Mandatory = $true, |
|
|
|
ParameterSetName = "Disable" |
|
|
|
)] |
|
|
|
[switch] |
|
|
|
$Disable |
|
|
|
) |
|
|
|
|
|
|
|
switch ($PSCmdlet.ParameterSetName) |
|
|
|
{ |
|
|
|
"Enable" |
|
|
|
{ |
|
|
|
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force |
|
|
|
New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force |
|
|
|
} |
|
|
|
"Disable" |
|
|
|
{ |
|
|
|
Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore |
|
|
|
Remove-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
<# |
|
|
|
.SYNOPSIS |
|
|
|
Network adapters power management |
|
|
@ -5912,28 +5869,23 @@ function IPv6Component |
|
|
|
ParameterSetName = "Enable" |
|
|
|
)] |
|
|
|
[switch] |
|
|
|
$Enable |
|
|
|
$Enable, |
|
|
|
|
|
|
|
[Parameter( |
|
|
|
Mandatory = $true, |
|
|
|
ParameterSetName = "PreferIPv4overIPv6" |
|
|
|
)] |
|
|
|
[switch] |
|
|
|
$PreferIPv4overIPv6 |
|
|
|
) |
|
|
|
|
|
|
|
try |
|
|
|
function IPv6SupportByISP |
|
|
|
{ |
|
|
|
# Check the internet connection |
|
|
|
$Parameters = @{ |
|
|
|
Uri = "https://www.google.com" |
|
|
|
Method = "Head" |
|
|
|
DisableKeepAlive = $true |
|
|
|
UseBasicParsing = $true |
|
|
|
} |
|
|
|
if (-not (Invoke-WebRequest @Parameters).StatusDescription) |
|
|
|
{ |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
# Check whether the https://ipv6-test.com site is alive |
|
|
|
# Check the internet connection |
|
|
|
$Parameters = @{ |
|
|
|
Uri = "https://ipv6-test.com" |
|
|
|
Uri = "https://www.google.com" |
|
|
|
Method = "Head" |
|
|
|
DisableKeepAlive = $true |
|
|
|
UseBasicParsing = $true |
|
|
@ -5943,33 +5895,50 @@ function IPv6Component |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
# Check whether the ISP supports IPv6 protocol using https://ipv6-test.com |
|
|
|
$Parameters = @{ |
|
|
|
Uri = "https://v4v6.ipv6-test.com/api/myip.php?json" |
|
|
|
UseBasicParsing = $true |
|
|
|
try |
|
|
|
{ |
|
|
|
# Check whether the https://ipv6-test.com site is alive |
|
|
|
$Parameters = @{ |
|
|
|
Uri = "https://ipv6-test.com" |
|
|
|
Method = "Head" |
|
|
|
DisableKeepAlive = $true |
|
|
|
UseBasicParsing = $true |
|
|
|
} |
|
|
|
if (-not (Invoke-WebRequest @Parameters).StatusDescription) |
|
|
|
{ |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
# Check whether the ISP supports IPv6 protocol using https://ipv6-test.com |
|
|
|
$Parameters = @{ |
|
|
|
Uri = "https://v4v6.ipv6-test.com/api/myip.php?json" |
|
|
|
UseBasicParsing = $true |
|
|
|
} |
|
|
|
$IPVersion = (Invoke-RestMethod @Parameters).proto |
|
|
|
} |
|
|
|
catch [System.Net.WebException] |
|
|
|
{ |
|
|
|
Write-Warning -Message ($Localization.NoResponse -f "https://ipv6-test.com") |
|
|
|
Write-Error -Message ($Localization.NoResponse -f "https://ipv6-test.com") -ErrorAction SilentlyContinue |
|
|
|
|
|
|
|
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue |
|
|
|
} |
|
|
|
$IPVersion = (Invoke-RestMethod @Parameters).proto |
|
|
|
} |
|
|
|
catch [System.Net.WebException] |
|
|
|
{ |
|
|
|
Write-Warning -Message ($Localization.NoResponse -f "https://ipv6-test.com") |
|
|
|
Write-Error -Message ($Localization.NoResponse -f "https://ipv6-test.com") -ErrorAction SilentlyContinue |
|
|
|
Write-Warning -Message $Localization.NoInternetConnection |
|
|
|
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue |
|
|
|
|
|
|
|
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue |
|
|
|
} |
|
|
|
} |
|
|
|
catch [System.Net.WebException] |
|
|
|
{ |
|
|
|
Write-Warning -Message $Localization.NoInternetConnection |
|
|
|
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue |
|
|
|
|
|
|
|
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue |
|
|
|
} |
|
|
|
|
|
|
|
switch ($PSCmdlet.ParameterSetName) |
|
|
|
{ |
|
|
|
"Disable" |
|
|
|
{ |
|
|
|
IPv6SupportByISP |
|
|
|
|
|
|
|
if ($IPVersion -ne "ipv6") |
|
|
|
{ |
|
|
|
Disable-NetAdapterBinding -Name * -ComponentID ms_tcpip6 |
|
|
@ -5977,11 +5946,17 @@ function IPv6Component |
|
|
|
} |
|
|
|
"Enable" |
|
|
|
{ |
|
|
|
IPv6SupportByISP |
|
|
|
|
|
|
|
if ($IPVersion -eq "ipv6") |
|
|
|
{ |
|
|
|
Enable-NetAdapterBinding -Name * -ComponentID ms_tcpip6 |
|
|
|
} |
|
|
|
} |
|
|
|
"PreferIPv4overIPv6" |
|
|
|
{ |
|
|
|
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -Name DisabledComponents -PropertyType DWord -Value 32 -Force |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -7036,6 +7011,59 @@ public static string GetString(uint strId) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
<# |
|
|
|
.SYNOPSIS |
|
|
|
The the latest installed .NET runtime for all apps usage |
|
|
|
|
|
|
|
.PARAMETER Enable |
|
|
|
Use the latest installed .NET runtime for all apps |
|
|
|
|
|
|
|
.PARAMETER Disable |
|
|
|
Do not use the latest installed .NET runtime for all apps |
|
|
|
|
|
|
|
.EXAMPLE |
|
|
|
LatestInstalled.NET -Enable |
|
|
|
|
|
|
|
.EXAMPLE |
|
|
|
LatestInstalled.NET -Disable |
|
|
|
|
|
|
|
.NOTES |
|
|
|
Machine-wide |
|
|
|
#> |
|
|
|
function LatestInstalled.NET |
|
|
|
{ |
|
|
|
param |
|
|
|
( |
|
|
|
[Parameter( |
|
|
|
Mandatory = $true, |
|
|
|
ParameterSetName = "Enable" |
|
|
|
)] |
|
|
|
[switch] |
|
|
|
$Enable, |
|
|
|
|
|
|
|
[Parameter( |
|
|
|
Mandatory = $true, |
|
|
|
ParameterSetName = "Disable" |
|
|
|
)] |
|
|
|
[switch] |
|
|
|
$Disable |
|
|
|
) |
|
|
|
|
|
|
|
switch ($PSCmdlet.ParameterSetName) |
|
|
|
{ |
|
|
|
"Enable" |
|
|
|
{ |
|
|
|
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force |
|
|
|
New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force |
|
|
|
} |
|
|
|
"Disable" |
|
|
|
{ |
|
|
|
Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore |
|
|
|
Remove-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
<# |
|
|
|
.SYNOPSIS |
|
|
|
The location to save screenshots by pressing Win+PrtScr |
|
|
@ -7188,6 +7216,10 @@ function RecommendedTroubleshooting |
|
|
|
} |
|
|
|
|
|
|
|
# Set the OS level of diagnostic data gathering to "Optional diagnostic data" |
|
|
|
if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack)) |
|
|
|
{ |
|
|
|
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Force |
|
|
|
} |
|
|
|
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 3 -Force |
|
|
|
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name MaxTelemetryAllowed -PropertyType DWord -Value 3 -Force |
|
|
|
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Name ShowedToastAtLevel -PropertyType DWord -Value 3 -Force |
|
|
@ -10691,7 +10723,7 @@ function SetAppGraphicsPerformance |
|
|
|
New-Item -Path HKCU:\Software\Microsoft\DirectX\UserGpuPreferences -Force |
|
|
|
} |
|
|
|
New-ItemProperty -Path HKCU:\Software\Microsoft\DirectX\UserGpuPreferences -Name $OpenFileDialog.FileName -PropertyType String -Value "GpuPreference=2;" -Force |
|
|
|
Write-Verbose -Message ("{0}" -f $OpenFileDialog.FileName) -Verbose |
|
|
|
Write-Verbose -Message $OpenFileDialog.FileName -Verbose |
|
|
|
} |
|
|
|
} |
|
|
|
"1" |
|
|
@ -10806,6 +10838,13 @@ function CleanupTask |
|
|
|
[switch] |
|
|
|
$Register, |
|
|
|
|
|
|
|
[Parameter( |
|
|
|
Mandatory = $false |
|
|
|
)] |
|
|
|
[ValidateSet("30", "60", "90")] |
|
|
|
[string] |
|
|
|
$Period, |
|
|
|
|
|
|
|
[Parameter( |
|
|
|
Mandatory = $true, |
|
|
|
ParameterSetName = "Delete" |
|
|
@ -10828,6 +10867,27 @@ function CleanupTask |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
# Checking if we're trying to create the task when it was already created as another user |
|
|
|
if (Get-ScheduledTask -TaskPath "\Sophia\" -TaskName CleanupTask) |
|
|
|
{ |
|
|
|
# Also we can parse $env:SystemRoot\System32\Tasks\Sophia\CleanupTask to check if the task was created |
|
|
|
$ScheduleService = New-Object -ComObject Schedule.Service |
|
|
|
$ScheduleService.Connect() |
|
|
|
$ScheduleService.GetFolder("\Sophia").GetTasks(0) | Where-Object -FilterScript {$_.Name -eq "CleanupTask"} | Foreach-Object { |
|
|
|
# Get user's SID the task was created as |
|
|
|
$SID = ([xml]$_.xml).Task.Principals.Principal.UserID |
|
|
|
} |
|
|
|
# Convert SID to username |
|
|
|
$TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 |
|
|
|
|
|
|
|
if ($TaskUserAccount -ne $env:USERNAME) |
|
|
|
{ |
|
|
|
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $TaskUserAccount) -Verbose |
|
|
|
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
# Remove all old tasks |
|
|
|
# We have to use -ErrorAction Ignore in both cases, unless we get an error |
|
|
|
Get-ScheduledTask -TaskPath "\Sophia Script\", "\SophiApp\" -ErrorAction Ignore | ForEach-Object -Process { |
|
|
@ -11007,7 +11067,7 @@ public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow); |
|
|
|
$Action = New-ScheduledTaskAction -Execute powershell.exe -Argument "-WindowStyle Hidden -Command $ToastNotification" |
|
|
|
$Settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable |
|
|
|
$Principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -RunLevel Highest |
|
|
|
$Trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 30 -At 9pm |
|
|
|
$Trigger = New-ScheduledTaskTrigger -Daily -DaysInterval $Period -At 9pm |
|
|
|
$Parameters = @{ |
|
|
|
TaskName = "Windows Cleanup Notification" |
|
|
|
TaskPath = "Sophia" |
|
|
@ -11092,6 +11152,13 @@ function SoftwareDistributionTask |
|
|
|
[switch] |
|
|
|
$Register, |
|
|
|
|
|
|
|
[Parameter( |
|
|
|
Mandatory = $false |
|
|
|
)] |
|
|
|
[ValidateSet("30", "60", "90")] |
|
|
|
[string] |
|
|
|
$Period, |
|
|
|
|
|
|
|
[Parameter( |
|
|
|
Mandatory = $true, |
|
|
|
ParameterSetName = "Delete" |
|
|
@ -11104,6 +11171,27 @@ function SoftwareDistributionTask |
|
|
|
{ |
|
|
|
"Register" |
|
|
|
{ |
|
|
|
# Checking if we're trying to create the task when it was already created as another user |
|
|
|
if (Get-ScheduledTask -TaskPath "\Sophia\" -TaskName SoftwareDistribution) |
|
|
|
{ |
|
|
|
# Also we can parse $env:SystemRoot\System32\Tasks\Sophia\SoftwareDistribution to check if the task was created |
|
|
|
$ScheduleService = New-Object -ComObject Schedule.Service |
|
|
|
$ScheduleService.Connect() |
|
|
|
$ScheduleService.GetFolder("\Sophia").GetTasks(0) | Where-Object -FilterScript {$_.Name -eq "SoftwareDistribution"} | Foreach-Object { |
|
|
|
# Get user's SID the task was created as |
|
|
|
$SID = ([xml]$_.xml).Task.Principals.Principal.UserID |
|
|
|
} |
|
|
|
# Convert SID to username |
|
|
|
$TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 |
|
|
|
|
|
|
|
if ($TaskUserAccount -ne $env:USERNAME) |
|
|
|
{ |
|
|
|
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $TaskUserAccount) -Verbose |
|
|
|
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
# Remove all old tasks |
|
|
|
# We have to use -ErrorAction Ignore in both cases, unless we get an error |
|
|
|
Get-ScheduledTask -TaskPath "\Sophia Script\", "\SophiApp\" -ErrorAction Ignore | ForEach-Object -Process { |
|
|
@ -11167,7 +11255,7 @@ Get-ChildItem -Path `$env:SystemRoot\SoftwareDistribution\Download -Recurse -For |
|
|
|
$Action = New-ScheduledTaskAction -Execute powershell.exe -Argument "-WindowStyle Hidden -Command $SoftwareDistributionTask" |
|
|
|
$Settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable |
|
|
|
$Principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -RunLevel Highest |
|
|
|
$Trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 90 -At 9pm |
|
|
|
$Trigger = New-ScheduledTaskTrigger -Daily -DaysInterval $Period -At 9pm |
|
|
|
$Parameters = @{ |
|
|
|
TaskName = "SoftwareDistribution" |
|
|
|
TaskPath = "Sophia" |
|
|
@ -11247,6 +11335,13 @@ function TempTask |
|
|
|
[switch] |
|
|
|
$Register, |
|
|
|
|
|
|
|
[Parameter( |
|
|
|
Mandatory = $false |
|
|
|
)] |
|
|
|
[ValidateSet("30", "60", "90")] |
|
|
|
[string] |
|
|
|
$Period, |
|
|
|
|
|
|
|
[Parameter( |
|
|
|
Mandatory = $true, |
|
|
|
ParameterSetName = "Delete" |
|
|
@ -11259,6 +11354,27 @@ function TempTask |
|
|
|
{ |
|
|
|
"Register" |
|
|
|
{ |
|
|
|
# Checking if we're trying to create the task when it was already created as another user |
|
|
|
if (Get-ScheduledTask -TaskPath "\Sophia\" -TaskName Temp) |
|
|
|
{ |
|
|
|
# Also we can parse $env:SystemRoot\System32\Tasks\Sophia\Temp to check if the task was created |
|
|
|
$ScheduleService = New-Object -ComObject Schedule.Service |
|
|
|
$ScheduleService.Connect() |
|
|
|
$ScheduleService.GetFolder("\Sophia").GetTasks(0) | Where-Object -FilterScript {$_.Name -eq "Temp"} | Foreach-Object { |
|
|
|
# Get user's SID the task was created as |
|
|
|
$SID = ([xml]$_.xml).Task.Principals.Principal.UserID |
|
|
|
} |
|
|
|
# Convert SID to username |
|
|
|
$TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 |
|
|
|
|
|
|
|
if ($TaskUserAccount -ne $env:USERNAME) |
|
|
|
{ |
|
|
|
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $TaskUserAccount) -Verbose |
|
|
|
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
# Remove all old tasks |
|
|
|
# We have to use -ErrorAction Ignore in both cases, unless we get an error |
|
|
|
Get-ScheduledTask -TaskPath "\Sophia Script\", "\SophiApp\" -ErrorAction Ignore | ForEach-Object -Process { |
|
|
@ -11321,7 +11437,7 @@ Get-ChildItem -Path `$env:TEMP -Recurse -Force | Where-Object -FilterScript {`$_ |
|
|
|
$Action = New-ScheduledTaskAction -Execute powershell.exe -Argument "-WindowStyle Hidden -Command $TempTask" |
|
|
|
$Settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable |
|
|
|
$Principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -RunLevel Highest |
|
|
|
$Trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 60 -At 9pm |
|
|
|
$Trigger = New-ScheduledTaskTrigger -Daily -DaysInterval $Period -At 9pm |
|
|
|
$Parameters = @{ |
|
|
|
TaskName = "Temp" |
|
|
|
TaskPath = "Sophia" |
|
|
|