VMware Cloud Community
RobMokkink
Expert
Expert

plink script + return value

I have some plink scripts for stuff the vitoolkit can handle.

To get the outcome of a particular command i do the following:

invoke expression $COMMAND | out-string

But i am searching for a way to get the access denied message. The method above doesn give me an output.

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership

Afaik, capturing output from an EXE in PowerShell is a bit of a problem.

See Shay's comment in Keith Hill's blog on Effective PowerShell Item 7: Understanding "Output".


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

RobMokkink
Expert
Expert

Oké, it's to bad. That it doesn work.

Reply
0 Kudos