I need to get a list of all virtualportgroups from vCenter but filter only for the ones prefixed by "dv-vm-" and pipe it out to a text file.
Note, I am pretty new to PowerCLI so simple works best for me...…..lol
Thanks
Like this?
Get-VirtualPortGroup -Name dv-vm-* |
Out-File -FilePath .\portgroups.txt
Or do you want to see specific properties?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Like this?
Get-VirtualPortGroup -Name dv-vm-* |
Out-File -FilePath .\portgroups.txt
Or do you want to see specific properties?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
@LucD, Thanks!
Looks like it came with more fields than I need...…. Key, VLANID, etc....
How do I get ~just~ the name?
Sorry man, I'm a noob at PowerCLI.
No problem, we all started with this stuff at some point :smileygrin:
Try like this
Get-VirtualPortGroup -Name dv-vm-* |
Select -ExpandProperty Name |
Out-File -FilePath .\portgroups.txt
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference