VMware Cloud Community
jpoling
Enthusiast
Enthusiast
Jump to solution

Update Manager cmdlets

I am getting an error trying to attach a baseline to a VM using PowerCLI Update mgr cmdlets:

C:\scripts> get-vm 'CMS Preview' | attach-baseline -baseline

'vSphere Upgrade'

Attach-Baseline : Cannot bind parameter 'Baseline'. Cannot convert the "vSphere

Upgrade" value of type "System.String" to type "VMware.VumAutomation.Types.Bas

eline".

At line:1 char:49

+ get-vm 'CMS Preview' | attach-baseline -baseline <<<< 'vSphere Upgrade'

+ CategoryInfo : InvalidArgument: (Smiley Happy , Paramete

rBindingException

+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,VMware.VumAutomat

ion.Commands.AttachBaseline

Anyone else seen this?

Thanks,

Jeff

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

The Attach-Baseline cmdlet above attaches a baseline to a host or guest.

Or is it something else you mean ?

____________

Blog: LucD notes

Twitter: lucd22


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

View solution in original post

0 Kudos
5 Replies
LucD
Leadership
Leadership
Jump to solution

I think you should do

get-vm 'CMS Preview' | attach-baseline -baseline (get-baseline 'vSphere Upgrade')

The -Baseline parameter expects a baseline object not a string.

Btw, note that each baseline has a targettype. For this baseline that should be a host, so I don't think you can assign it to a guest.

____________

Blog: LucD notes

Twitter: lucd22


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

jpoling
Enthusiast
Enthusiast
Jump to solution

Thanks! I realized I created a baseline group with the same name (vSphere Upgrade). Is there a way to attach baseline groups using the update manager cmdlets?

Jeff

0 Kudos
LucD
Leadership
Leadership
Jump to solution

The Attach-Baseline cmdlet above attaches a baseline to a host or guest.

Or is it something else you mean ?

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
jpoling
Enthusiast
Enthusiast
Jump to solution

From the vSphere Client, I can attach a baseline group - which has several baselines in it. Is it possible to attach baseline groups using the cmdlets?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Ok, I (finally) see what you mean Smiley Wink

No, the Attach-Baseline cmdlet can't handle groups.

And there is no Attach-Group cmdlet I'm afraid.

____________

Blog: LucD notes

Twitter: lucd22


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