param([switch]$Elevated) if ((Test-Admin) -eq $false) { if ($elevated) { # tried to elevate, did not work, aborting } else { Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition)) } exit } Get-WindowsUpdate -AcceptAll -Install if (Get-Command "scoop.exe" -ErrorAction SilentlyContinue) { scoop update scoop update --all scoop cache rm * } if (Get-Command "bleachbit.exe" -ErrorAction SilentlyContinue) { # Clean everything selected in the UI last time it was run. # So... run The UI to set things up initially. bleachbit --preset --clean }