Q. Do normal Windows commands run in PowerShell?

Generally, yes. There are times, however, when PowerShell's parsing of commands results in unexpected and confusing errors.

Don Jones

September 22, 2010

1 Min Read
black asphalt road with cloud on horizon

Q. Do normal Windows commands run in PowerShell?

A. Generally, yes. There are times, however, when PowerShell's parsing of commands results in unexpected and confusing errors. Sometimes, you'll need to enclose your entire command string within quotation marks and use the shell's invoke operator to run the command:

&"SC.EXE STOP WUAUSERV"

That's a good example because it uses the external Sc.exe command rather than PowerShell's internal SC alias. If you just run

SC STOP WUAUSERV

the built-in SC command will run, accepting STOP and WUAUSERV as input parameters. As a result, you'll get an error.

Do you have a Windows PowerShell question? Find more PowerShell FAQs, articles, and other resources at windowsitpro.com/go/DonJonesPowerShell.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like