How to run a powershell script with white spaces in path from command line?

后端 未结 5 1281
既然无缘
既然无缘 2020-12-03 10:36

So I\'ve tried a bunch of different ways to run a powershell script from the command line and every single one returns an error.

Here is this path:



        
5条回答
  •  暖寄归人
    2020-12-03 11:31

    In case you use parameters you can do as follow

    powershell.exe -command "& {&'C:\A B C\foo.ps1' param1 param2}"
    

    Thanks at this point to Hesham A. Amin :-)

提交回复
热议问题