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

  1. Copy powershell.ps1 from \\fileserver\scripts  to  "%systemdrive%\Tools\Scripts" local computer;

    REM powershell.ps1 file
    robocopy \\filerserver\Scripts %systemdrive%\Tools\Scripts powershell.ps1

     

  2. Execute the powershell.ps1 file

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

你可能感兴趣的:(批处理,powershell,远程)