I'm doing my first powershell scripting for vmware and I'm wondering how to check the return status from an operation. Most of the examples just assume that everything works as planned
In particular, I'm using the new-snapshot and remove-snapshot operations.
If someone can give me a pointer to the right place in some documentation, I'll be happy to take it from there.
Thanks!
Pat
First of all you can examine the $? and the $error variable.
See Tobias's chapter on handling PS errors here.
In fact the complete series is ideal for new and intermediate PS users.
In PS you can also use trap to capture errors and display/return error messages and return codes.
Yasen gave a very good explanation on the use of trap and the VITK in .
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
First of all you can examine the $? and the $error variable.
See Tobias's chapter on handling PS errors here.
In fact the complete series is ideal for new and intermediate PS users.
In PS you can also use trap to capture errors and display/return error messages and return codes.
Yasen gave a very good explanation on the use of trap and the VITK in .
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for the pointer. This will get me going.