added cleanmgr to script

This commit is contained in:
2022-09-08 14:41:54 -04:00
parent 4b60a13ceb
commit 16db6cf5bf
+10
View File
@@ -75,6 +75,11 @@ If ( IsAdmin )
ForEach ( $tempfile in $AutoCADTempFiles ) { Remove-Item $tempfile -Force -ErrorAction SilentlyContinue } ForEach ( $tempfile in $AutoCADTempFiles ) { Remove-Item $tempfile -Force -ErrorAction SilentlyContinue }
} }
} }
# Silently run cleanmgr.exe with default settings
LogMsg "Running cleanmgr.exe with default settings"
Try { Start-Process "cleanmgr.exe" -ArgumentList "/VERYLOWDISK" }
Catch { LogErr $_.Exception.Message }
} }
# Only run this section if we don't have administrative privileges # Only run this section if we don't have administrative privileges
@@ -98,4 +103,9 @@ Else
ForEach ( $tempfile in $AutoCADTempFiles ) { Remove-Item $tempfile -Force -ErrorAction SilentlyContinue } ForEach ( $tempfile in $AutoCADTempFiles ) { Remove-Item $tempfile -Force -ErrorAction SilentlyContinue }
} }
} }
# Silently run cleanmgr.exe with default settings
LogMsg "Running cleanmgr.exe with default settings"
Try { Start-Process "cleanmgr.exe" -ArgumentList "/VERYLOWDISK" }
Catch { LogErr $_.Exception.Message }
} }