Reputation: 1995
I am trying to write a small powershell script that checks the health of a newly started server. Here's what I want to do:
Test-Connection MyDCServer -Quiet
using Invoke-VMScript
I have 1. and 2. donem but I am running into trouble on 3. All I get back from Invoke-VMScript
is a string presenting the output from the script, when I really want the return value from the script that I invoked.
Is this possible?
Upvotes: 0
Views: 544
Reputation: 1995
I found the solution:
$result = Invoke-VMScript ...
$result.ScriptOutput
$result.ExitCode
Upvotes: 1