Closed aamodei closed 2 months ago
It seems there is issue in passing $org variable to Organization parameter in target policy.
As a workaround if you are cloning the bios policy under same org then you may omit Organization parameter in target. as below
PolicyTarget = Initialize-IntersightBiosPolicy -Name $NewPolicyName
If you want to clone a policy into other organization then use Organization parameter in New-IntersightBulkMoCloner cmdlet as below
# Initialize Port Policy Target
$PolicyTarget = Initialize-IntersightBiosPolicy -Name $NewPolicyName
# Create Port Policy Clone
$Result = New-IntersightBulkMoCloner -Sources $PolicySrc -Targets $PolicyTarget -Organization $NewOrgObj
Describe the bug Unable to use the "New-IntersightBulkMoCloner" cmdlet, it will either result in "Error calling CreateBulkMoCloner" with no further observable data OR Error calling CreateBulkMoCloner: {"Responses":[{"ObjectType":"bulk.RestResult","ClassId":"bulk.RestResult","Status":400,"Body":"{\"code\":\"InvalidRequest\",\"message\":\"Cannot execute the request. The JSON document is malformed.\" (when following example here - https://github.com/sandkum5/intersight-scripts/blob/main/powershell/clone-policies/cloneBiosPolicy.ps1)
To Reproduce (I have just included the snippet) the $existingpolicy.moid is an existing bios policy created by using the UI, $neworgobj is populated from Get-IntersightOrganizationOrganization.
Initialize Port Policy Source
Version used
Expected behavior Based on the example/explanation, a clone of the existing bios policy values under a new bios policy