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

时间:2014-03-27 09:00:27

标签: 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
    + FullyQualifiedErrorId : CommandNotFoundException*

我的脚本包含

$letterArray = "a","b","c","d"
foreach ($letter in $letterArray)
{
   Write-Host $letter
}

1 个答案:

答案 0 :(得分:0)

将脚本移动到另一个(更深)文件夹并再试一次?你也可以尝试

& c:\test.ps1
相关问题