Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 201745

Re: detailed information with start-vm

$
0
0

If you only want to see a message when the start fails, you would be better off with a Try-Catch construct.

Something like this

 

$vmName="MyVM"
try {
 
$ProgressPreference="SilentlyContinue"
 
$vm=Get-VM-Name$vmName-ErrorActionSilentlyContinue
 
Start-VM-VM$vm-ErrorActionSilentlyContinue|Out-Null
}
catch {
 
"$vmName failed to start"
}

Viewing all articles
Browse latest Browse all 201745

Trending Articles



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