minor fixes for userprofile cleaning
This commit is contained in:
@@ -118,7 +118,7 @@ ForEach ( $userProfile in $(EnumUserProfiles) ) {
|
|||||||
|
|
||||||
# Remove AutoCAD temp files
|
# Remove AutoCAD temp files
|
||||||
If (-not (IsRunning -Name "acad") ) {
|
If (-not (IsRunning -Name "acad") ) {
|
||||||
$AutoCADTempFiles = Get-ChildItem -Path "${Env:TEMP}\*" -File -Include '*.ac$' -ErrorAction SilentlyContinue
|
$AutoCADTempFiles = Get-ChildItem -Path "${userProfile}\AppData\Local\Temp\*" -File -Include '*.ac$' -ErrorAction SilentlyContinue
|
||||||
If ( $AutoCADTempFiles ) {
|
If ( $AutoCADTempFiles ) {
|
||||||
LogMsg "Deleting AutoCAD temp files"
|
LogMsg "Deleting AutoCAD temp files"
|
||||||
ForEach ( $tempfile in $AutoCADTempFiles ) {
|
ForEach ( $tempfile in $AutoCADTempFiles ) {
|
||||||
@@ -210,7 +210,7 @@ ForEach ( $userProfile in $(EnumUserProfiles) ) {
|
|||||||
If ( Test-Path $ToDelete ) {
|
If ( Test-Path $ToDelete ) {
|
||||||
|
|
||||||
# Delete the duplicate file
|
# Delete the duplicate file
|
||||||
LogMsg "Deleting duplicate download: ""$ToDelete"""
|
LogMsg "Deleting duplicate download: ""${ToDelete}"""
|
||||||
Try { Remove-Item -Path $ToDelete -Force -ErrorAction SilentlyContinue }
|
Try { Remove-Item -Path $ToDelete -Force -ErrorAction SilentlyContinue }
|
||||||
Catch { LogErr $_.Exception.Message }
|
Catch { LogErr $_.Exception.Message }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user