Problem uninstall Visual Studio 2019

Hi to all gurus :slight_smile:

I have built a Visual studio 2019 community edition package.
When I run the uninstall process in a batch, its works fine:

"c:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe" uninstall --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" --quiet --norestart

When trying with PowerShell code, its failing. I have tried all kind of quotation marks options, but all is failing.

Message        : Cannot process argument transformation on parameter 'WindowStyle'. Cannot convert value "C:\Program                 Files (x86)\Microsoft Visual Studio\2019\Community" to type "System.Diagnostics.ProcessWindowStyle".

 Error: "Unable to match the identifier name C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community to a valid enumerator name. Specify one of the following enumerator names and try again:  Normal, Hidden, Minimized, Maximized"

InnerException : System.Management.Automation.ArgumentTransformationMetadataException: Cannot convert value
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" to type
"System.Diagnostics.ProcessWindowStyle". Error: "Unable to match the identifier name C:\Program Files
(x86)\Microsoft Visual Studio\2019\Community to a valid enumerator name. Specify one of the following
enumerator names and try again:

[I used the following command line in PSADT]

Execute-Process -path "c:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe" uninstall --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" -parameters "--quiet --norestart"

Can you please help.

Thank you so much
Amir

Amir,

everything after "c:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe" are parameters.

you should be able to figure this out.

1 Like

After a lot of combinations and experiments … It worked out just fine :slight_smile:
Thanks

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.