Run PS commands in cmd?

I googled this and found five different links which all provide the same usage.

I’m trying to open cmd and run

Powershell.exe -command “&{restart-service -force -name ‘service-name’}”

But I keep getting an error

“Missing expression after unary operator ‘-‘“

Every time I try net stop and start that doesn’t work either because net start doesn’t wait for net stop to finish so it tries to start a service that is still being stopped. So I’m trying to do PS since there’s no net restart

submitted by /u/Dryinganddying
[link] [comments]

Leave a Reply