I prefer to set Connect-VIServer to a variable and -NotDefault then then set the -Server attribute on any Get-* New-* cmdlets. E.G.
$viserver = Connect-VIServer -Server vc1 -Credential $cred -NotDefault
Get-VMHost -Server $viserver
However the New-SpbmRuleSet doesn’t have a -Server attribute but errors if there is not a Default connection set.
Working example but doesn’t limit to a specific vCenter. Needs extra logic to ensure only one vCenter is in the default varriable.
Connect-VIServer -Server vc1 -Credential $cred New-SpbmRuleSet -AllOfRules $rules
Prefered code but fails with unkown -Server attribute
$viserver = Connect-VIServer -Server vc1 -Credential $cred New-SpbmRuleSet -Server $viserver -AllOfRules $rules
Is there a work-around although this looks like an over-sight in the cmdlet?
Otherwise anyone know how to report a bug / feature request for PowerCli so that I can register an interest in having the -Server attribute added to the New-SpbmRuleSet cmdlet.