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

Re: VMs status in the list

$
0
0

Thanks for the quick reply again and Thanks for the great help.

 

I already removed the quote from the "status".

But when i tried run just below line, I am getting the below error.

<

PowerCLI C:\Scripts> $vm = Get-VM VMname1 if($vm) {$vm.powerstate} else {"Not  found"}

Get-VM : A positional parameter cannot be found that accepts argument 'if'.

At line:1 char:13

+ $vm = Get-VM <<<<  VMName1 if($vm) {$vm.powerstate} else {"Not found"}

    + CategoryInfo          : InvalidArgument: (:) [Get-VM], ParameterBindingException

    + FullyQualifiedErrorId : PositionalParameterNotFound,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM

>

Not sure, if it helps you to find what i am doing wrong in the script?


Viewing all articles
Browse latest Browse all 225435

Trending Articles



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