credog
asked on
Powershell Uninstall via uninstall string
I have the PS command below that I'm trying to use to uninstall onedrive on some systems. The command "C:\Users\joe\AppData\Local\Microsoft\...." works fine from a standard Windows cmd.exe, but doesn't seem to work when in the PS command below. I've tried various quoting and it doesn't seem to make a difference.
$output = Test-Path "C:\Users\joe\AppData\Local\Microsoft\OneDrive\20.143.0716.0003_1\OneDriveSetup.exe" ; if ($output -ne "True"){ $result='Removal path not found' } else { $result= 'Removing Onedrive';"C:\Users\joe\AppData\Local\Microsoft\OneDrive\20.143.0716.0003_1\OneDriveSetup.exe /uninstall" }; $result
Also tried using the PS Uninstall-Package cmdlet instead of the C:\... command and that didn't seem to work at all.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.