added removal of Autodesk installers

This commit is contained in:
2023-01-16 12:55:48 -05:00
parent 35e3bcd03d
commit fab9912fc8
+12
View File
@@ -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