So this is my code
$result = Invoke-Command -Session $session -FilePath $ps1
How do I get the result given by $ps1?
The code of that function is supposed to give a true false result like in the following:
function MyFunction{#some codeif ($JobStatus -like "Running") { $result = $false Write-Host "Gresit" -foreground Red } else { $result = $true Write-Host "Corect" -foreground Green }return $result}
I added this command and unfortunately I have red output
if ( $result -eq $null ) { write-host "Result: $result" -foreground Red }