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.
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
Oké, it's to bad. That it doesn work.