Importing Module in a remote session

I’m having trouble getting the output from a command I’m invoking on a remote computer. Code snippet below:

$websites = Invoke-Command -ComputerName $server -Credential $creds -ScriptBlock{ Import-Module WebAdministration Get-Website } 

I cannot get the output from Get-Website to return… Credentials are good, remote server is up and running, WinRM is configured… I can’t wrap my head around this

submitted by /u/automation-dev
[link] [comments]

Leave a Reply