$server1 = "dc-1"
$server2 = 'dc-2'
$server3 = 'app'
$computers = ( $server1, $server2, $server3 )
$result3 = Invoke-Command -Credential $domaincredentials -ComputerName $computers -ScriptBlock {
$SB = {
$objht = @{}
$objht.Testa = 'testa'
$objht.Testb = 'testb'
$objht.Testc = 'testc'
New-Object psobject -propertyh $sb
}
}
write-host $result3