File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,10 +68,26 @@ if ( $userinput -eq 'y' -or !$userinput ) {
6868 $Services = Get-Content .\Config\services.json | ConvertFrom-Json
6969
7070 for ($i = 0 ; $i -lt $Services.service.name.Count ; $i ++ ) {
71- $Services.service.name [$i ] | Set-Service - StartupType $Services.service.StartupType [$i ] | Out-Null
71+ $Services.service.name [$i ] | Set-Service - StartupType $Services.service.StartupType [$i ] - ErrorAction SilentlyContinue
7272 }
7373
7474 Write-Output "
75+ If you see any errors stating "" Service wasn't found"" or "" Access is denied,"" don't worry, nothing is wrong.
76+ "
77+ }
78+
79+ # Delete C:\Windows\Temp and user's temporary files
80+ $userinput = Read-Host - Prompt ' Do you want to delete temporary files (Recommended) (Y/n)'
81+ if ( $userinput -eq ' y' -or ! $userinput ) {
82+ Write-Output " Removing Windows Temporary Files (C:\Windows\Temp)"
83+ Start-Sleep 1
84+ Get-ChildItem - Path " C:\Windows\Temp" * .* - Recurse | Remove-Item - Force - Recurse - ErrorAction SilentlyContinue
7585
76- If you see any errors stating Service wasn't found or Access is denied, don't worry, nothing is wrong."
86+ Write-Output " Removing User Temporary Files ($env: TEMP )"
87+ Start-Sleep 1
88+ Get-ChildItem - Path $env: TEMP * .* - Recurse | Remove-Item - Force - Recurse - ErrorAction SilentlyContinue
89+
90+ Write-Output "
91+ If you see any errors stating "" Access is denied,"" don't worry, nothing is wrong.
92+ "
7793}
You can’t perform that action at this time.
0 commit comments