Browse Source

Add files via upload

pull/149/head 5.7
Dmitry Nefedov 3 years ago
committed by GitHub
parent
commit
35021b4dd4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 54
      Sophia/PowerShell 7.x/Sophia.ps1
  2. BIN
      Sophia/PowerShell 7.x/Sophia.psd1
  3. 231
      Sophia/PowerShell 7.x/Sophia.psm1

54
Sophia/PowerShell 7.x/Sophia.ps1

@ -2,8 +2,8 @@
.SYNOPSIS .SYNOPSIS
Default preset file for "Windows 10 Sophia Script" Default preset file for "Windows 10 Sophia Script"
Version: v5.6 Version: v5.7
Date: 02.03.2021 Date: 05.03.2021
Copyright (c) 20152021 farag & oZ-Zo Copyright (c) 20152021 farag & oZ-Zo
https://github.com/farag2 https://github.com/farag2
@ -57,7 +57,7 @@ param
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script v5.6 | $([char]0x00A9) farag & oz-zo, 2015–2021" $Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script v5.7 | $([char]0x00A9) farag & oz-zo, 2015–2021"
Remove-Module -Name Sophia -Force -ErrorAction Ignore Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Sophia.psd1 -PassThru -Force Import-Module -Name $PSScriptRoot\Sophia.psd1 -PassThru -Force
@ -348,11 +348,11 @@ FileTransferDialog -Detailed
# FileTransferDialog -Compact # FileTransferDialog -Compact
# Expand the File Explorer ribbon # Expand the File Explorer ribbon
# Развернуть ленут проводника # Развернуть ленту проводника
FileExplorerRibbon -Expanded FileExplorerRibbon -Expanded
# Minimize the File Explorer ribbon (default value) # Minimize the File Explorer ribbon (default value)
# Свернуть ленут проводника (значение по умолчанию) # Свернуть ленту проводника (значение по умолчанию)
# FileExplorerRibbon -Minimized # FileExplorerRibbon -Minimized
# Display the recycle bin files delete confirmation # Display the recycle bin files delete confirmation
@ -415,6 +415,14 @@ TrayIcons -Show
# Не отображать все значки в области уведомлений (значение по умолчанию) # Не отображать все значки в области уведомлений (значение по умолчанию)
# TrayIcons -Hide # TrayIcons -Hide
# Hide the Meet Now icon in the notification area
# Скрыть иконку "Провести собрание" в трее
MeetNow -Hide
# Show the Meet Now icon in the notification area
# Отобразить иконку "Провести собрание" в трее
# MeetNow -Show
# Unpin "Microsoft Edge" and "Microsoft Store" from the taskbar # Unpin "Microsoft Edge" and "Microsoft Store" from the taskbar
# Открепить Microsoft Edge и Microsoft Store от панели задач # Открепить Microsoft Edge и Microsoft Store от панели задач
UnpinTaskbarEdgeStore UnpinTaskbarEdgeStore
@ -1014,44 +1022,44 @@ GPUScheduling -Enable
#region Scheduled tasks #region Scheduled tasks
<# <#
Create the "Windows Cleanup" scheduled task for cleaning up unused files and Windows updates Create the "Windows Cleanup" scheduled task for cleaning up Windows unused files and updates
A minute before the task starts, a warning in the Windows action center will appear A native interactive toast notification pops up every 30 days
The task runs every 90 days The task runs every 30 days
Создать задачу "Windows Cleanup" по очистке неиспользуемых файлов и обновлений Windows в Планировщике задач Создать задачу "Windows Cleanup" по очистке неиспользуемых файлов и обновлений Windows в Планировщике заданий
За минуту до выполнения задачи в Центре уведомлений Windows появится предупреждение Нативный интерактивный тост всплывает каждые 30 дней
Задача выполняется каждые 90 дней Задача выполняется каждые 30 дней
#> #>
CleanUpTask -Register CleanupTask -Register
# Delete the "Windows Cleanup" scheduled task for cleaning up unused files and Windows updates # Delete the "Windows Cleanup" and "Windows Cleanup Notification" scheduled tasks for cleaning up Windows unused files and updates
# Удалить задачу "Windows Cleanup" по очистке неиспользуемых файлов и обновлений Windows из Планировщика задач # Удалить задачу "Windows Cleanup" и "Windows Cleanup Notification" по очистке неиспользуемых файлов и обновлений Windows из Планировщика заданий
# CleanUpTask -Delete # CleanupTask -Delete
<# <#
Create the "SoftwareDistribution" scheduled task for cleaning up the %SystemRoot%\SoftwareDistribution\Download folder Create the "SoftwareDistribution" scheduled task for cleaning up the %SystemRoot%\SoftwareDistribution\Download folder
The task runs on Thursdays every 4 weeks The task runs every 90 days
Создать задачу "SoftwareDistribution" по очистке папки %SystemRoot%\SoftwareDistribution\Download в Планировщике задач Создать задачу "SoftwareDistribution" по очистке папки %SystemRoot%\SoftwareDistribution\Download в Планировщике заданий
Задача выполняется по четвергам каждую 4 неделю Задача выполняется каждые 90 дней
#> #>
SoftwareDistributionTask -Register SoftwareDistributionTask -Register
# Delete the "SoftwareDistribution" scheduled task for cleaning up the %SystemRoot%\SoftwareDistribution\Download folder # Delete the "SoftwareDistribution" scheduled task for cleaning up the %SystemRoot%\SoftwareDistribution\Download folder
# Удалить задачу "SoftwareDistributionp" по очистке папки %SystemRoot%\SoftwareDistribution\Download из Планировщика задач # Удалить задачу "SoftwareDistribution" по очистке папки %SystemRoot%\SoftwareDistribution\Download из Планировщика заданий
# SoftwareDistributionTask -Delete # SoftwareDistributionTask -Delete
<# <#
Create the "Temp" scheduled task for cleaning up the %TEMP% folder Create the "Temp" scheduled task for cleaning up the %TEMP% folder
The task runs every 62 days The task runs every 60 days
Создать задачу "Temp" в Планировщике задач по очистке папки %TEMP% Создать задачу "Temp" в Планировщике заданий по очистке папки %TEMP%
Задача выполняется каждые 62 дня Задача выполняется каждые 60 дней
#> #>
TempTask -Register TempTask -Register
# Delete the "Temp" scheduled task for cleaning up the %TEMP% folder # Delete the "Temp" scheduled task for cleaning up the %TEMP% folder
# Удалить задачу "Temp" по очистке папки %TEMP% из Планировщика задач # Удалить задачу "Temp" по очистке папки %TEMP% из Планировщика заданий
# TempTask -Delete # TempTask -Delete
#endregion Scheduled tasks #endregion Scheduled tasks

BIN
Sophia/PowerShell 7.x/Sophia.psd1

Binary file not shown.

231
Sophia/PowerShell 7.x/Sophia.psm1

@ -2,8 +2,8 @@
.SYNOPSIS .SYNOPSIS
"Windows 10 Sophia Script" is a PowerShell module for Windows 10 fine-tuning and automating the routine tasks "Windows 10 Sophia Script" is a PowerShell module for Windows 10 fine-tuning and automating the routine tasks
Version: v5.6 Version: v5.7
Date: 02.03.2021 Date: 05.03.2021
Copyright (c) 20152021 farag & oZ-Zo Copyright (c) 20152021 farag & oZ-Zo
https://github.com/farag2 https://github.com/farag2
@ -105,6 +105,7 @@ function Checkings
"1" "1"
{ {
Write-Warning -Message $Localization.ControlledFolderAccessDisabled Write-Warning -Message $Localization.ControlledFolderAccessDisabled
$Script:ControlledFolderAccess = $true $Script:ControlledFolderAccess = $true
Set-MpPreference -EnableControlledFolderAccess Disabled Set-MpPreference -EnableControlledFolderAccess Disabled
@ -2423,6 +2424,77 @@ function TrayIcons
} }
} }
<#
.SYNOPSIS
Configure the Meet Now icon in the notification area
.PARAMETER Hide
Hide the Meet Now icon in the notification area
.PARAMETER Show
Show the Meet Now icon in the notification area
.EXAMPLE
MeetNow -Hide
.EXAMPLE
MeetNow -Show
.NOTES
Current user only
#>
function MeetNow
{
param
(
[Parameter(
Mandatory = $true,
ParameterSetName = "Show"
)]
[switch]
$Show,
[Parameter(
Mandatory = $true,
ParameterSetName = "Hide"
)]
[switch]
$Hide
)
switch ($PSCmdlet.ParameterSetName)
{
"Show"
{
$Settings = Get-ItemPropertyValue -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3 -Name Settings -ErrorAction Ignore
$Settings[9] = 0
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3 -Name Settings -PropertyType Binary -Value $Settings -Force
}
"Hide"
{
$Settings = Get-ItemPropertyValue -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3 -Name Settings -ErrorAction Ignore
$Settings[9] = 128
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3 -Name Settings -PropertyType Binary -Value $Settings -Force
}
}
# Save all opened folders in order to restore them after File Explorer restart
Clear-Variable -Name OpenedFolders -Force -ErrorAction Ignore
$OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke()
# In order for the changes to take effect the File Explorer process has to be restarted
Stop-Process -Name explorer -Force
# Restoring closed folders
foreach ($OpenedFolder in $OpenedFolders)
{
if (Test-Path -Path $OpenedFolder)
{
Invoke-Item -Path $OpenedFolder
}
}
}
<# <#
.SYNOPSIS .SYNOPSIS
Unpin "Microsoft Edge" and "Microsoft Store" from the taskbar Unpin "Microsoft Edge" and "Microsoft Store" from the taskbar
@ -5482,7 +5554,6 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
} }
# Pictures # Pictures
Write-Verbose -Message $Localization.PicturesDriveSelect -Verbose Write-Verbose -Message $Localization.PicturesDriveSelect -Verbose
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
@ -7203,6 +7274,7 @@ function EnableWSL2
Invoke-WebRequest @Parameters Invoke-WebRequest @Parameters
Write-Verbose -Message $Localization.WSLUpdateInstalling -Verbose Write-Verbose -Message $Localization.WSLUpdateInstalling -Verbose
Start-Process -FilePath "$DownloadsFolder\wsl_update_x64.msi" -ArgumentList "/passive" -Wait Start-Process -FilePath "$DownloadsFolder\wsl_update_x64.msi" -ArgumentList "/passive" -Wait
Remove-Item -Path "$DownloadsFolder\wsl_update_x64.msi" -Force Remove-Item -Path "$DownloadsFolder\wsl_update_x64.msi" -Force
@ -7649,6 +7721,12 @@ public static string GetString(uint strId)
Start-Sleep -Seconds 3 Start-Sleep -Seconds 3
# Open the Start menu to load the new layout
$wshell = New-Object -ComObject WScript.Shell
$wshell.SendKeys("^{ESC}")
Start-Sleep -Seconds 3
# Enable changing the Start menu layout # Enable changing the Start menu layout
Remove-ItemProperty -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name LockedStartLayout -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name LockedStartLayout -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name StartLayoutFile -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name StartLayoutFile -Force -ErrorAction Ignore
@ -7658,6 +7736,10 @@ public static string GetString(uint strId)
Stop-Process -Name StartMenuExperienceHost -Force -ErrorAction Ignore Stop-Process -Name StartMenuExperienceHost -Force -ErrorAction Ignore
Start-Sleep -Seconds 3 Start-Sleep -Seconds 3
# Open the Start menu to load the new layout
$wshell = New-Object -ComObject WScript.Shell
$wshell.SendKeys("^{ESC}")
} }
} }
#endregion Start menu #endregion Start menu
@ -8391,26 +8473,26 @@ function GPUScheduling
#region Scheduled tasks #region Scheduled tasks
<# <#
.SYNOPSIS .SYNOPSIS
The "Windows Cleanup" scheduled task for cleaning up unused files and Windows updates The "Windows Cleanup" scheduled task for cleaning up Windows unused files and updates
.PARAMETER Register .PARAMETER Register
Create the "Windows Cleanup" scheduled task for cleaning up unused files and Windows updates Create the "Windows Cleanup" scheduled task for cleaning up Windows unused files and updates
.PARAMETER Delete .PARAMETER Delete
Delete the "Windows Cleanup" scheduled task for cleaning up unused files and Windows updates Delete the "Windows Cleanup" and "Windows Cleanup Notification" scheduled tasks for cleaning up Windows unused files and updates
.EXAMPLE .EXAMPLE
CleanUpTask -Register CleanupTask -Register
.EXAMPLE .EXAMPLE
CleanUpTask -Delete CleanupTask -Delete
.NOTES .NOTES
A minute before the task starts, a warning in the Windows action center will appear A native interactive toast notification pops up every 30 days
The task runs every 30 days
Current user Current user
The task runs every 90 days
#> #>
function CleanUpTask function CleanupTask
{ {
param param
( (
@ -8470,23 +8552,9 @@ function CleanUpTask
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force
} }
$TaskScript = @" $CleanupTask = @"
`$cleanmgr = """{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\cleanmgr.exe"""
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]
`$Template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
`$ToastXML = [xml]`$Template.GetXml()
`$ToastXML.GetElementsByTagName("""text""").AppendChild(`$ToastXML.CreateTextNode("""$($Localization.CleanUpTaskToast)"""))
`$XML = New-Object -TypeName Windows.Data.Xml.Dom.XmlDocument
`$XML.LoadXml(`$ToastXML.OuterXml)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier(`$cleanmgr).Show(`$XML)
Get-Process -Name cleanmgr | Stop-Process -Force Get-Process -Name cleanmgr | Stop-Process -Force
Start-Sleep -Seconds 60
`$ProcessInfo = New-Object -TypeName System.Diagnostics.ProcessStartInfo `$ProcessInfo = New-Object -TypeName System.Diagnostics.ProcessStartInfo
`$ProcessInfo.FileName = """$env:SystemRoot\system32\cleanmgr.exe""" `$ProcessInfo.FileName = """$env:SystemRoot\system32\cleanmgr.exe"""
`$ProcessInfo.Arguments = """/sagerun:1337""" `$ProcessInfo.Arguments = """/sagerun:1337"""
@ -8549,17 +8617,95 @@ while (`$true)
`$Process.Start() | Out-Null `$Process.Start() | Out-Null
"@ "@
$Action = New-ScheduledTaskAction -Execute powershell.exe -Argument "-WindowStyle Hidden -Command $TaskScript" # Create the "Windows Cleanup" task
$Trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 90 -At 9am $Action = New-ScheduledTaskAction -Execute powershell.exe -Argument "-WindowStyle Hidden -Command $CleanupTask"
$Settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable $Settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable
$Principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -RunLevel Highest $Principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -RunLevel Highest
$Description = $Localization.CleanUpTaskDescription
$Parameters = @{ $Parameters = @{
"TaskName" = "Windows Cleanup" "TaskName" = "Windows Cleanup"
"TaskPath" = "Sophia Script" "TaskPath" = "Sophia Script"
"Principal" = $Principal "Principal" = $Principal
"Action" = $Action "Action" = $Action
"Description" = $Description "Description" = $Localization.CleanupTaskDescription
"Settings" = $Settings
}
Register-ScheduledTask @Parameters -Force
# Persist the Settings notifications to prevent to immediately disappear from Action Center
if (-not (Test-Path -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel"))
{
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel" -Force
}
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel" -Name ShowInActionCenter -PropertyType DWORD -Value 1 -Force
# Register the "WindowsCleanup" protocol to be able to run the scheduled task upon clicking on the "Run" button
if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\WindowsCleanup))
{
New-Item -Path Registry::HKEY_CLASSES_ROOT\WindowsCleanup -Force
}
New-itemproperty -Path Registry::HKEY_CLASSES_ROOT\WindowsCleanup -Name "(Default)" -PropertyType String -Value "url:WindowsCleanup" -Force
New-itemproperty -Path Registry::HKEY_CLASSES_ROOT\WindowsCleanup -Name "URL Protocol" -Value "" -Force
New-itemproperty -Path Registry::HKEY_CLASSES_ROOT\WindowsCleanup -Name EditFlags -PropertyType DWord -Value 2162688 -Force
if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\Shell\Open\command))
{
New-item -Path Registry::HKEY_CLASSES_ROOT\WindowsCleanup\Shell\Open\command -Force
}
# If "Run" clicked run the "Windows Cleanup" task
New-itemproperty -Path Registry::HKEY_CLASSES_ROOT\WindowsCleanup\Shell\Open\command -Name "(Default)" -PropertyType String -Value 'powershell.exe -Command "& {Start-ScheduledTask -TaskPath ''\Sophia Script\'' -TaskName ''Windows Cleanup''}"' -Force
$ToastNotification = @"
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime]
[xml]`$ToastTemplate = @"""
<toast duration="""Long""" scenario="""reminder""">
<visual>
<binding template="""ToastGeneric""">
<text>$($Localization.CleanupTaskNotificationTitle)</text>
<group>
<subgroup>
<text hint-style="""title""" hint-wrap="""true""">$($Localization.CleanupTaskNotificationEventTitle)</text>
</subgroup>
</group>
<group>
<subgroup>
<text hint-style="""body""" hint-wrap="""true""">$($Localization.CleanupTaskNotificationEvent)</text>
</subgroup>
</group>
</binding>
</visual>
<audio src="""ms-winsoundevent:notification.default""" />
<actions>
<input id="""SnoozeTimer""" type="""selection""" title="""$($Localization.CleanupTaskNotificationSnoozeInterval)""" defaultInput="""1""">
<selection id="""1""" content="""$($Localization.Minute)""" />
<selection id="""30""" content="""$($Localization.HalfHour)""" />
<selection id="""240""" content="""$($Localization.FourHours)""" />
</input>
<action activationType="""system""" arguments="""snooze""" hint-inputId="""SnoozeTimer""" content="""$($Localization.Snooze)""" id="""test-snooze"""/>
<action arguments="""WindowsCleanup:""" content="""$($Localization.Run)""" activationType="""protocol"""/>
<action arguments="""dismiss""" content="""$($Localization.Dismiss)""" activationType="""system"""/>
</actions>
</toast>
"""@
$`ToastXml = [Windows.Data.Xml.Dom.XmlDocument]::New()
$`ToastXml.LoadXml($`ToastTemplate.OuterXml)
$`ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($`ToastXML)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("""windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel""").Show($`ToastMessage)
"@
# Create the "Windows Cleanup Notification" task
$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
$Parameters = @{
"TaskName" = "Windows Cleanup Notification"
"TaskPath" = "Sophia Script"
"Principal" = $Principal
"Action" = $Action
"Description" = $Localization.CleanupNotificationTaskDescription
"Settings" = $Settings "Settings" = $Settings
"Trigger" = $Trigger "Trigger" = $Trigger
} }
@ -8568,6 +8714,7 @@ while (`$true)
"Delete" "Delete"
{ {
Unregister-ScheduledTask -TaskName "Windows Cleanup" -Confirm:$false Unregister-ScheduledTask -TaskName "Windows Cleanup" -Confirm:$false
Unregister-ScheduledTask -TaskName "Windows Cleanup Notification" -Confirm:$false
} }
} }
} }
@ -8589,7 +8736,7 @@ while (`$true)
SoftwareDistributionTask -Delete SoftwareDistributionTask -Delete
.NOTES .NOTES
The task runs on Thursdays every 4 weeks The task runs every 90 days
Current user Current user
#> #>
function SoftwareDistributionTask function SoftwareDistributionTask
@ -8620,7 +8767,7 @@ function SoftwareDistributionTask
Get-ChildItem -Path $env:SystemRoot\SoftwareDistribution\Download -Recurse -Force | Remove-Item -Recurse -Force Get-ChildItem -Path $env:SystemRoot\SoftwareDistribution\Download -Recurse -Force | Remove-Item -Recurse -Force
"@ "@
$Action = New-ScheduledTaskAction -Execute powershell.exe -Argument $Argument $Action = New-ScheduledTaskAction -Execute powershell.exe -Argument $Argument
$Trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 90 -At 9am $Trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 90 -At 9pm
$Settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable $Settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable
$Principal = New-ScheduledTaskPrincipal -UserId "NT AUTHORITY\SYSTEM" -RunLevel Highest $Principal = New-ScheduledTaskPrincipal -UserId "NT AUTHORITY\SYSTEM" -RunLevel Highest
$Description = $Localization.FolderTaskDescription -f "$env:SystemRoot\SoftwareDistribution\Download" $Description = $Localization.FolderTaskDescription -f "$env:SystemRoot\SoftwareDistribution\Download"
@ -8659,7 +8806,7 @@ Get-ChildItem -Path $env:SystemRoot\SoftwareDistribution\Download -Recurse -Forc
TempTask -Delete TempTask -Delete
.NOTES .NOTES
The task runs every 62 days The task runs every 60 days
Current user Current user
#> #>
function TempTask function TempTask
@ -8687,18 +8834,18 @@ function TempTask
{ {
$Argument = "Get-ChildItem -Path $env:TEMP -Force -Recurse | Remove-Item -Recurse -Force" $Argument = "Get-ChildItem -Path $env:TEMP -Force -Recurse | Remove-Item -Recurse -Force"
$Action = New-ScheduledTaskAction -Execute powershell.exe -Argument $Argument $Action = New-ScheduledTaskAction -Execute powershell.exe -Argument $Argument
$Trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 62 -At 9am $Trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 60 -At 9pm
$Settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable $Settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable
$Principal = New-ScheduledTaskPrincipal -UserId "NT AUTHORITY\SYSTEM" -RunLevel Highest $Principal = New-ScheduledTaskPrincipal -UserId "NT AUTHORITY\SYSTEM" -RunLevel Highest
$Description = $Localization.FolderTaskDescription $Description = $Localization.FolderTaskDescription
$Parameters = @{ $Parameters = @{
"TaskName" = "Temp" "TaskName" = "Temp"
"TaskPath" = "Sophia Script" "TaskPath" = "Sophia Script"
"Principal" = $Principal "Principal" = $Principal
"Action" = $Action "Action" = $Action
"Description" = $Description "Description" = $Description
"Settings" = $Settings "Settings" = $Settings
"Trigger" = $Trigger "Trigger" = $Trigger
} }
Register-ScheduledTask @Parameters -Force Register-ScheduledTask @Parameters -Force
} }
@ -8820,7 +8967,7 @@ function RemoveAllowedAppsControlledFolder
# Add a folder to the exclusion from Microsoft Defender scanning # Add a folder to the exclusion from Microsoft Defender scanning
function AddDefenderExclusionFolder function AddDefenderExclusionFolder
{ {
$Title = $Localization.DefenderTitle $Title = "Microsoft Defender"
$Message = $Localization.DefenderExclusionFolderRequest $Message = $Localization.DefenderExclusionFolderRequest
$Add = $Localization.Add $Add = $Localization.Add
$Skip = $Localization.Skip $Skip = $Localization.Skip

Loading…
Cancel
Save