VMware Cloud Community
8i5
Contributor
Contributor
Jump to solution

Wildcards in get-view

Does anyone have details on how to use wildcards with the get-view commandlet?

e.g.

get-view -viewtype virtualmachine -filter @{"Name" = "server*"}

where I want to return all vms with beginning with the name server

This doesn't work but I'm sure there is some syntax available to make this work

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

In the Get-View filter you can use a set of regex expressions

get-view -viewtype virtualmachine -filter @{"Name" = "^server"}

This will resturn every virtualmachine whose name starts with "server".

In VMware PowerCLI and Get-View filters you'll find some more info.


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

In the Get-View filter you can use a set of regex expressions

get-view -viewtype virtualmachine -filter @{"Name" = "^server"}

This will resturn every virtualmachine whose name starts with "server".

In VMware PowerCLI and Get-View filters you'll find some more info.


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

0 Kudos
8i5
Contributor
Contributor
Jump to solution

Thanks a bunch

0 Kudos