Hi all,
I am somewhat of a newbie on PowerShell and scripting but got the basics down (and the ability to search the interweb)
However I can't seem to find any oneliners, or scripts that does what I want. I almost got there with a oneliner myself - put almost is not good enough.
What I want is to list all VMs with snapshost and the following information:
VM name
VM description (name of contact person is here and I am contemplating on putting contactpersons email adresse here)
Snapshot name
Snapshot description
Snapshot creation date.
I found that get-vm | select Name, Description gives me the info on the VM.
I found that get-snapshost | select Name, Description, Created gives me the info on the snapshots. But combined it does not give me all I want.
What almost got me there was: get-vm | get-snapshot | select VM, Name, Description, Created
This does not give med the description on given VM. What it gives me is VMs name, Snapshosts name, Snapshots description and created date.
Any one with any pointers?
Best regards,
Kristian
something like this?
Get-VM | Get-Snapshot | ` Select @{Name="VM"; Expression={$_.VM.Name}}, @{Name="VM_Description"; Expression={$_.VM.Description}}, @{Name="Snapshot"; Expression={$_.Name}}, @{Name="Snapshot_Description"; Expression={$_.Description}}
something like this?
Get-VM | Get-Snapshot | ` Select @{Name="VM"; Expression={$_.VM.Name}}, @{Name="VM_Description"; Expression={$_.VM.Description}}, @{Name="Snapshot"; Expression={$_.Name}}, @{Name="Snapshot_Description"; Expression={$_.Description}}
Hi again,
And thank you for your swift response esarakaitis
This looks like it does exactly what I want ! Now I just have to get it presented in a nice fashion!
Thank you again esarakaitis!
regards,
Kristian
anytime, you could always use the built-in option of export to csv
I have done so. Export-csv is my friend
Kristian