cmd命令调用powershell脚本方法

cmd方法:

powershell -command ". ('ps1脚本路径'); WriteInfo  -param 'param参数值'"

ps1脚本代码:

function WriteInfo
{

  Param($param);

  Write-Host $param;

}

 

其中,. ('ps1脚本路径');“.”后面带有一个空格。

posted @ 2016-10-14 10:40  廉价拉菲  阅读(820)  评论(0编辑  收藏  举报