major update to override Write-Output func

This commit is contained in:
2023-10-05 13:11:38 -04:00
parent 31a06a9206
commit bbb4884818
52 changed files with 377 additions and 378 deletions
+11 -11
View File
@@ -6,38 +6,38 @@ If ( $PATH )
$SVC = Get-Service -Name "AdAppMgrSvc"
If ( $SVC.Status -ne "Stopped" )
{
LogMsg "Stopping AdAppMgrSvc service"
Write-Output "Stopping AdAppMgrSvc service"
Try { $SVC | Stop-Service -Force }
Catch { LogMsg $_.Exception.Message }
Catch { Write-Output $_.Exception.Message }
}
LogMsg "Stopping processes"
Write-Output "Stopping processes"
Try
{
Get-Process | Where { $_.Name -like "AdAppMgr" } | Stop-Process -Force
Get-Process | Where { $_.Name -like "AutodeskDesktopApp" } | Stop-Process -Force
}
Catch { LogMsg $_.Exception.Message }
Catch { Write-Output $_.Exception.Message }
LogMsg "Uninstalling Autodesk Desktop App"
Write-Output "Uninstalling Autodesk Desktop App"
Try { Start-Process -FilePath $PATH -ArgumentList '--mode unattended' -Wait }
Catch { LogMsg $_.Exception.Message }
Catch { Write-Output $_.Exception.Message }
If ( Test-Path "HKLM:\SOFTWARE\Wow6432Node\Autodesk\Autodesk Application Manager" ) {
LogMsg "Removing: ""HKLM:\SOFTWARE\Wow6432Node\Autodesk\Autodesk Application Manager"""
Write-Output "Removing: ""HKLM:\SOFTWARE\Wow6432Node\Autodesk\Autodesk Application Manager"""
Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Autodesk\Autodesk Application Manager" -Force -ErrorAction SilentlyContinue
}
If ( Test-Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Autodesk Desktop App" ) {
LogMsg "Removing: ""HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Autodesk Desktop App"""
Write-Output "Removing: ""HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Autodesk Desktop App"""
Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Autodesk Desktop App" -Force -ErrorAction SilentlyContinue
}
If ( Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AdAppMgrSvc.exe" ) {
LogMsg "Removing: ""HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AdAppMgrSvc.exe"""
Write-Output "Removing: ""HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AdAppMgrSvc.exe"""
Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AdAppMgrSvc.exe" -Force -ErrorAction SilentlyContinue
}
If ( Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutodeskDesktopApp.exe" ) {
LogMsg "Removing: ""HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutodeskDesktopApp.exe"""
Write-Output "Removing: ""HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutodeskDesktopApp.exe"""
Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutodeskDesktopApp.exe" -Force -ErrorAction SilentlyContinue
}
}
Else { LogMsg "Autodesk Desktop App is not installed" }
Else { Write-Output "Autodesk Desktop App is not installed" }