我尝试了很多种在命令行中运行PowerShell脚本的方法,但每一种都返回错误。
这是该路径:
这是路径:
C:\Users\test\Documents\test\line space\PS Script\test.ps1
我尝试过这些:
powershell -File '"C:\Users\test\Documents\test\line space\PS Script\test.ps1"'
powershell "& ""C:\Users\test\Documents\test\line space\PS Script\test.ps1"""
Powershell "& 'C:\Users\test\Documents\test\line space\PS Script\test.ps1'"
Powershell -File 'C:\Users\test\Documents\test\line space\PS Script\test.ps1'"
我遇到了以下这些错误:
& : 无法将'C:\Users\test\Documents\test\line space\PS Script' 识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请验证路径是否正确,然后重试。
Processing -File ''C:\Users\test\Documents\test\line space\PS Script'' failed: 给定路径的格式不受支持。请指定有效的路径作为 -File 参数。
我该如何解决?