Reply to Message

View discussion in a popup

Replying to:
LucD
Leadership
Leadership

Ok, got it.
I suspect there might be an issue with the Get-VM line.

That ErrorAction will result in your code never reaching the catch-block.

Try changing that line to

$script:target = Get-VM $line -ErrorAction Stop


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos