您的位置:首页 > 运维架构 > Shell

32. PowerShell -- 批处理中执行远程的powershell脚本的方法

2015-05-07 16:15 495 查看
Copy powershell.ps1 from \\fileserver\scripts to "%systemdrive%\Tools\Scripts" local computer;
REM powershell.ps1 file
robocopy \\filerserver\Scripts %systemdrive%\Tools\Scripts powershell.ps1

Execute the powershell.ps1 file
REM Execute powershell.ps1 file
powershell -ExecutionPolicy RemoteSigned "%systemdrive%\Tools\Scripts\powershell.ps1"

PowerShell.exe .\powershell.ps1 %–parameter1% 1 %–parameter2% 2
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息