作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在运行 Windows 7 RTM。默认安装 PowerShell 2.0。我正在使用优秀的 Windows PowerShell ISE编辑我的脚本。我有以下脚本:
Param($p)
Param($d)
echo $p $d
./SayItAgain -p "Hello"
The term 'Param' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\users\cius\Code\powershell\SayItAgain.ps1:2 char:6
+ Param <<<< ($destination)
+ CategoryInfo : ObjectNotFound: (Param:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
最佳答案
如果您的 param($p)
不是脚本中可能导致参数错误的第一行。
确保您的 param($p)
是第一行。
关于PowerShell 2.0 和 "The term ' Param' 未被识别为 cmdlet、函数、脚本文件或可运行程序的名称”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1315140/
我是一名优秀的程序员,十分优秀!