black asphalt road with cloud on horizon

Q. Do normal Windows commands run in PowerShell?

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.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish