Quantcast
Channel: VMware Communities : All Content - VMware View
Viewing all articles
Browse latest Browse all 9103

View Client exit code without specifying "-unattended" or "-noninteractive"

$
0
0

I am using a powershell script that uses get-credential to prompt for credentials and then launches the view client with the "-username" and "-password" switches. (For various reasons) I don't want the view client to launch until after credentials have been submitted. The script waits for the view client to exit, and then based on whether the exit code was zero or non-zero, it performs actions. Unfortunately, if neither "-unattended" or "-noninteractive" are specified, the exit code is always 0, regardless of whether or not the connection was successful.

 

I tried the "-unattended" switch, and if the view client fails to connect, it exits with the appropriate code and the error message can be read from standardoutput. This allowed me to catch the error message and read it back to the user so they would know why it failed to connect. Also, the view client shows the steps of the connection process to let the user know what is going on. Prefect! However, the option can only be used for kisok mode, so specifying the correct "-username", "-password", and "-desktopname" fails to connect. Boo.

 

I tried the "-noninteractive" switch, and if the view client fails to connect, it exits with the appropriate code, but the error message is not passed to standardoutput nor is it displayed. I can't tell the user why it failed to connect. Also, the view client does not show anything while it is trying to connect like "-unattended" does.

 

Is there some other way/place to get the exit code of the last attempted connection somewhere other than by specifying "-unattended" or "-noninteractive". It would be nice if, by default, the view client would at least give the correct exit code without needing to use one of those switches. That would give me the optimal behavior I am looking for.


Viewing all articles
Browse latest Browse all 9103

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>