Running CMD command in PowerShell

前端 未结 5 1152
逝去的感伤
逝去的感伤 2020-12-02 12:02

I am having a bunch of issues with getting a PowerShell command to run. All it is doing is running a command that would be run in a CMD prompt window.

Here is the co

5条回答
  •  猫巷女王i
    2020-12-02 12:35

    Try this:

    & "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\i386\CmRcViewer.exe" PCNAME
    

    To PowerShell a string "..." is just a string and PowerShell evaluates it by echoing it to the screen. To get PowerShell to execute the command whose name is in a string, you use the call operator &.

提交回复
热议问题