CiscoDevNet / intersight-powershell

Cisco Intersight PowerShell
Apache License 2.0
16 stars 4 forks source link

"Set-IntersightServerProfile -SrcTemplate $null" no longer working #168

Closed tbrock47 closed 1 month ago

tbrock47 commented 1 month ago

Describe the bug Unable to remove Server Profile Template from Server Profile using Set-IntersightServerProfile.

To Reproduce Steps to reproduce the behavior

$IntersightServerProfile = Get-IntersightServerProfile -Name $ServerProfileName
$IntersightServerProfile | Set-IntersightServerProfile -SrcTemplate $null
ERROR: Set-IntersightServerProfile: Object serialized to Array. JObject instance expected.

Version used

Expected behavior "$IntersightServerProfile | Set-IntersightServerProfile -SrcTemplate $null" used to remove the Server Profile Template from the requested profile, but no longer appears to work. Unsure what may have changed.

Screenshots image

Additional context Appears to only be an issue when piping the object as the following appears to work. Set-IntersightServerProfile -Moid $IntersightServerProfile.Moid -SrcTemplate $null

Ghufz commented 1 month ago

It is bug will work on it, Here is workaround to accomplish above configuration

$result = $IntersightServerProfile | Set-IntersightManagedObject -AddtionProperties @{"SrcTemplate"=$null} | ConvertFrom-Json
Ghufz commented 1 month ago

The issue has been addressed in the latest release https://www.powershellgallery.com/packages/Intersight.PowerShell/1.0.11.18775