My PowerCLI script includes the following statement:
get-vm $myvm | new-snapshot -name $mysnapshotname -Description $mydescription
It works fine, but I need to insert a test to see if the snapshot creation was successfull.
- How can I get and test a returncode from new-snapshot?
- How can I simulate an error in creating a snapshot in my lab environment in order to test my script?
Regards
marius