I am sure I have had this working before with no issues but now I am not sure what is going on.
Script1.ps1:
$Output = PowerShell.exe -File "C:\Temp1\Script2.ps1"
$Output.Value1
Script2.ps1:
$HashTable = New-Object PSObject -Property @{
"Value1" = "Data1"
"Value2" = "Data2"
"Value3" = "Data3"
}
return $HashTable
I was expecting to get a clean table that I could pull data from but instead I get this:
If I just run Script2 on it's own I can use $HashTable.Value1 but returning it to Script1 seems to be an issue.

hashtableactually starts with @. Here you are creating aPSObject.