Functions/Maintenance.ps1
function Maintenance { [CmdletBinding()] param ( [Parameter()] [switch] $UpdateAll, [Parameter()] [switch] $UpdatePSModules, [Parameter()] [switch] $UpdateHelp ) cua cr rdi Write-Host "`n----`n" Remove-DownloadFolderItems if ((Get-MpComputerStatus).QuickScanAge -gt 9) { Start-MpScan -AsJob } if ($UpdateAll -or $UpdatePSModules) { Start-Job -ScriptBlock { Get-InstalledModule | Update-Module -AcceptLicense -Verbose } } if ($UpdateAll -or $UpdateHelp) { Start-Job -ScriptBlock { Update-Help -Force -ea 0 } } } |