added removal of Autodesk installers
This commit is contained in:
@@ -104,6 +104,18 @@ If ( Test-Path $ESDB ) {
|
||||
|
||||
}
|
||||
|
||||
# Remove any Autodesk installers at their default location
|
||||
$ADSKInst = "${Env:SystemDrive}\Autodesk"
|
||||
If ( Test-Path $ADSKInst ) {
|
||||
$foldersToDelete = Get-ChildItem -Path $ADKSInst -ErrorAction SilentlyContinue | Where-Object { ($_.PSIsContainer) -and ($_.LastWriteTime -lt ((Get-Date) - $TimeDelta)) -and ( $_.Name -ne "WI") }
|
||||
ForEach ( $folder in $foldersToDelete ) {
|
||||
$path = $folder.FullName
|
||||
LogMsg "Deleting Autodesk installer directory: ""${path}"""
|
||||
Try { Remove-Item $folder -Force -Recurse -ErrorAction SilentlyContinue }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
}
|
||||
|
||||
# TODO: Evaluate system restore points and delete them if they take up too much space
|
||||
|
||||
# Remove files from user profile directories
|
||||
|
||||
Reference in New Issue
Block a user