VMware Cloud Community
ChargeOn
Contributor
Contributor
Jump to solution

PowerCLI get vApp Notes section

In vSphere there is a Notes section on the summary page of the vApp is there any way to access this using PowerCLI. I know you are able to get it from individual VMs but I have not found a way to accomplish this at the vApp level. Below is the way to get it from an individual VM.

$VMNotes = Get-VM "VMName" | Select-Object -ExpandProperty Notes

Note: If I change Get-VM to Get-VApp I get a "Select-Object : Property "Notes" cannot be found" error

Labels (6)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

If you just want to print the Notes to the screen, you could do

$vAppName = "NameOfVApp"

$vApp = Get-VApp -Name $vAppName
Write-Host "Note: $($vApp.ExtensionData.VAppConfig.Annotation)"


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

Try like this

Get-VApp |
Select Name,@{N='Notes';E={$_.ExtensionData.VAppConfig.Annotation}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ChargeOn
Contributor
Contributor
Jump to solution

While I don't get an error nothing is printed. I am very new to PowerCLI, this is what I have with nothing printing. I tried the suggested as well as what I have attached. Not sure if this is what you meant.

$vAppName = "NameOfVApp"

$VMNotes = Get-VApp | Select $vAppName,@{N='Notes';E={$_.ExtensionData.VAppConfig.Annotation}}

Write-Host "Note: $($VMNotes)"

 

0 Kudos
LucD
Leadership
Leadership
Jump to solution

If you just want to print the Notes to the screen, you could do

$vAppName = "NameOfVApp"

$vApp = Get-VApp -Name $vAppName
Write-Host "Note: $($vApp.ExtensionData.VAppConfig.Annotation)"


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos