Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 执行简单PS脚本时出现问题_Powershell - Fatal编程技术网

Powershell 执行简单PS脚本时出现问题

Powershell 执行简单PS脚本时出现问题,powershell,Powershell,PS C:>C:\test.ps1 Error: *The term 'c:\test.ps1' is not recognized as the name of a spelling of the name, or if a path was included, verify t At line:1 char:12 + c:\test.ps1 <<<< + CategoryInfo : ObjectNotFound: (c:\test.ps1

PS C:>C:\test.ps1

Error:
*The term 'c:\test.ps1' is not recognized as the name of a
 spelling of the name, or if a path was included, verify t
At line:1 char:12
+ c:\test.ps1 <<<<
    + CategoryInfo          : ObjectNotFound: (c:\test.ps1
    + FullyQualifiedErrorId : CommandNotFoundException*
是否将脚本移动到另一个(更深的)文件夹并重试?你也可以试试

& c:\test.ps1

您的脚本完全正常-是否确定它(1)存在于您指定的位置
c:\test.ps1
,以及(b)您运行PowerShell的用户帐户能够从该位置读取?
& c:\test.ps1