Quantcast
Channel: VMware Communities: Message List - VM List on conditions to be generated.
Browsing all 18 articles
Browse latest View live

VM List on conditions to be generated.

Hi All, I am trying to create a list of Windows VMs where I can do, but any export is filled with empty lines. Regardless of whether I use Export-CSV or Out-File when a VM is not Windows I get an empty...

View Article



Re: VM List on conditions to be generated.

Although the script could be optimised, it returns results, and they are written to the file.Are you sure there VMs that fit the 2 conditions (powered on and running a Windows guest OS) ? Is there...

View Article

Re: VM List on conditions to be generated.

It does return results which are written to the file. In fact it actually returns the correct results, which is a bonus. The file looks like Name...

View Article

Re: VM List on conditions to be generated.

Do you also get those blank lines when you change the last line to$allvms | Export-Csv "D:\temp\computers.csv" -NoTypeInformation -UseCulture

View Article

Re: VM List on conditions to be generated.

LucD wrote: Do you also get those blank lines when you change the last line to$allvms | Export-Csv "D:\temp\computers.csv" -NoTypeInformation -UseCultureYes, I get the same thing. I was using...

View Article


Re: VM List on conditions to be generated.

I mean, do you also get the blank lines when you open the CSV file with Excel ?

View Article

Re: VM List on conditions to be generated.

Yes. The same thing. I can accept why. The array which gets created has elements which are unset. Whether that is blank or null is not really for argument, as it is behaving as I expect it would. It is...

View Article

Re: VM List on conditions to be generated.

Can't you just update the script like this$allvms = @() $vmlist = Get-Vm | where {$_.PowerState -eq "PoweredOn"} ForEach ($vm in $vmlist){    $vmv = $vm | Get-View      $vms = "" | Select Name #, OS...

View Article


Re: VM List on conditions to be generated.

Brilliantly simple! I cannot believe that just moving the array increment up one loop level has resolved the problem. Just for anyone else thinking of the same thing, the full PS1 file is. If...

View Article


VM List on conditions to be generated.

Hi All, I am trying to create a list of Windows VMs where I can do, but any export is filled with empty lines. Regardless of whether I use Export-CSV or Out-File when a VM is not Windows I get an empty...

View Article

Re: VM List on conditions to be generated.

Although the script could be optimised, it returns results, and they are written to the file.Are you sure there VMs that fit the 2 conditions (powered on and running a Windows guest OS) ? Is there...

View Article

Re: VM List on conditions to be generated.

It does return results which are written to the file. In fact it actually returns the correct results, which is a bonus. The file looks like Name...

View Article

Re: VM List on conditions to be generated.

Do you also get those blank lines when you change the last line to$allvms | Export-Csv "D:\temp\computers.csv" -NoTypeInformation -UseCulture

View Article


Re: VM List on conditions to be generated.

LucD wrote: Do you also get those blank lines when you change the last line to$allvms | Export-Csv "D:\temp\computers.csv" -NoTypeInformation -UseCultureYes, I get the same thing. I was using...

View Article

Re: VM List on conditions to be generated.

I mean, do you also get the blank lines when you open the CSV file with Excel ?

View Article


Re: VM List on conditions to be generated.

Yes. The same thing. I can accept why. The array which gets created has elements which are unset. Whether that is blank or null is not really for argument, as it is behaving as I expect it would. It is...

View Article

Re: VM List on conditions to be generated.

Can't you just update the script like this$allvms = @() $vmlist = Get-Vm | where {$_.PowerState -eq "PoweredOn"} ForEach ($vm in $vmlist){    $vmv = $vm | Get-View      $vms = "" | Select Name #, OS...

View Article


Re: VM List on conditions to be generated.

Brilliantly simple! I cannot believe that just moving the array increment up one loop level has resolved the problem. Just for anyone else thinking of the same thing, the full PS1 file is. If...

View Article
Browsing all 18 articles
Browse latest View live




Latest Images