Powershell 执行简单PS脚本时出现问题
PS C:>C:\test.ps1Powershell 执行简单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
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