I have a situation regarding PSObject. Thing is when I write only the same PSObject in different script it returns what it should.
$returnobject = New-Object -TypeName psobject
$returnobject | Add-Member -MemberType NoteProperty -Name LocalITMail -Value "what"
$returnobject | Add-Member -MemberType NoteProperty -Name LocationSufix -Value "wont you "
$returnobject | Add-Member -MemberType NoteProperty -Name Webproxy -Value "work"
return $returnobject
I get this
which is good.
But when I call the function from bigger script the return type is not as the form above and I cannot access its properties.
Example:
What am I doing wrong, is there a way on how to return the PSObject type so I don't get this @{...}
output? Thanks.