基本上我想这样做:
foreach ($SERVER_NAME in $SERVER_NAME_LIST)
{
$SESSION = New-PSSession -ComputerName $SERVER_NAME -Credential $CRED
Invoke-Command -Session $SESSION -ScriptBlock
{
Write-Zip -Path $PATH -OutputPath test.zip -IncludeEmptyDirectories
}
}
我收到此错误:
The term 'Write-Zip' 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.
我真的必须在everey远程机器上安装扩展并import module
每次都调用吗?
在此先感谢您的帮助