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: ( , Paramete
rBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,VMware.VumAutomat
ion.Commands.AttachBaseline
Anyone else seen this?
Thanks,
Jeff
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
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
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
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
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?
Ok, I (finally) see what you mean
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