Powershell to display Regsvr32 result in console instead of dialog

Question:

I’ve searched but did not find any answer.
The task is register one dll using Powershell ps1, followed by other lines of scripts. I don’t want to be interrupted by the dialog, so added the /s parameter. But now the result information is ignored, no matter succeed or fail.
I want the result displayed in console. But how?

Answer:

Launch regsvr32.exe /s with Start-Process -PassThru and inspect the ExitCode property:

Source:

Powershell to display Regsvr32 result in console instead of dialog by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply