VMware Cloud Community
currie0n
Contributor
Contributor

Get-Compliance with a Baseline filter error

I want to run Get-Compliance with a baseline filter.

The baseline i want to filter on is VMware Tools Upgrade to Match Host (Predefined)

However when i run a simple

Get-Datacenter | Get-VM | Get-Compliance -Baseline "VMware Tools Upgrade to Match Host (Predefined)"

it returns an error of

Get-Complance : Cannot bind parameter 'Baseline'. Cannot convert the "VMware Tools Upgrade to Match Host (Predefined)" value of type 'System.String' to type "VMware.VumAutomation.Types.Baseline".

Any assistance here would be great.

Thanks,

0 Kudos
1 Reply
LucD
Leadership
Leadership

You have to provide an object that is returned by Get-Baseline to the Baseline parameter.

Try like this

Get-Datacenter | Get-VM | Get-Compliance -Baseline (Get-Baseline -Name "VMware Tools Upgrade to Match Host (Predefined)")


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

0 Kudos