basically I want to do this:
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
}
}
I get this error:
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.
Do I really have to install the extension on everey remote maschine and invoke the import module
every time?
Thanks in advance for your help