为了解技术思路,研究了一下powershell.
整个开发与部署过程如下:
1.下载WindowsXP-KB926139-v2-x86-ENU
安装powershell环境;
2.按照代码要求,写一个简单的脚本;
3. 运行powershell时,同 bat是有区别的.注意以下方法:
1) 解除限制:
set-executionpolicy Unrestricted
2) 将文件名保存为ps1
3) 通过以下方法运行(假如文件名是c:a.ps1)
PS C:> .a
[@more@]示例代码:
function foo ( [int] $x)
{
$x = $x + 1
echo $x
}
foo (1 )
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/197458/viewspace-1046295/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/197458/viewspace-1046295/