Hi
When using Add-VBRViJobObject and I add a vm to a job. Information is returned about the added vm. But If I try to add same vm again nothing happens. Shouldn't I get an error saying like "vm already in job".
Same thing with Remove-VBRJobObject. If I try to remove a object that is already removed. No errors is reported. Nothing like "vm not present in job".
Shouldn't there by any error handling?
\Masonit
-
- Service Provider
- Posts: 327
- Liked: 23 times
- Joined: Oct 09, 2012 2:30 pm
- Full Name: Maso
- Contact:
-
- Product Manager
- Posts: 20406
- Liked: 2299 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Add-VBRViJobObject, Remove-VBRJobObject error handling
Currently, those warnings do not exist in PowerShell.
If you want to handle this situation somehow, you will need to automatically check whether any information is returned regarding VM added; if not, it will mean that VM has been already added to the selected job.
Thanks!
If you want to handle this situation somehow, you will need to automatically check whether any information is returned regarding VM added; if not, it will mean that VM has been already added to the selected job.
Thanks!
-
- Service Provider
- Posts: 327
- Liked: 23 times
- Joined: Oct 09, 2012 2:30 pm
- Full Name: Maso
- Contact:
Re: Add-VBRViJobObject, Remove-VBRJobObject error handling
Ok. Information is only returned from Add-VBRViJobObject, not from Remove-VBRJobObject. But I could always check the job objects again to verify that vm is either added or removed.
\Masonit
\Masonit
-
- Product Manager
- Posts: 20406
- Liked: 2299 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Add-VBRViJobObject, Remove-VBRJobObject error handling
Correct, checking the number of objects afterwards sounds also like a good idea. Thanks!
Who is online
Users browsing this forum: Bing [Bot] and 11 guests