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

后端 未结 5 1278
既然无缘
既然无缘 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:30

    In your examples, you're mixing quotes and double quoting for no reason.

    IF EXIST "C:\Users\test\Documents\test\line space\PS Script\test.ps1" (
      powershell -ExecutionPolicy Unrestricted -File "C:\Users\test\Documents\test\line space\PS Script\test.ps1"
    )
    

提交回复
热议问题