Skip to content

Update Invoke-CIPPRestMethod.ps1 - #91

Merged
kris6673 merged 8 commits into
BNWEIN:Devfrom
jonwbstr:patch-1
May 14, 2026
Merged

Update Invoke-CIPPRestMethod.ps1#91
kris6673 merged 8 commits into
BNWEIN:Devfrom
jonwbstr:patch-1

Conversation

@jonwbstr

Copy link
Copy Markdown
Contributor

Add support for an array of hashtables.

To update the Hudu tenant mappings the body needs to be an array of hashtables.

$body = @{
	TenantId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
	Tenant = "Contoso, LLC";
	TenantDomain = "contoso.onmicrosoft.com";
	IntegrationId = 1122;
	IntegrationName = "Contoso, LLC"
	},@{
	TenantId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
	Tenant = "Acme, Inc";
	TenantDomain = "acmeinc.onmicrosoft.com";
	IntegrationId = 1122;
	IntegrationName = "Acme, Inc"
}
	
Invoke-CIPPRestMethod` -Endpoint '/api/ExecExtensionMapping' -method POST -Params @{AddMapping='Hudu'} -Body $body```

@kris6673

kris6673 commented May 14, 2026

Copy link
Copy Markdown
Collaborator

lgtm
Thanks for the PR!

@kris6673
kris6673 changed the base branch from main to Dev May 14, 2026 17:12
@kris6673
kris6673 merged commit b803bf8 into BNWEIN:Dev May 14, 2026
kris6673 added a commit that referenced this pull request Jul 14, 2026
The [hashtable[]] type introduced in #91 coerced every single
hashtable body into a one-element array, which ConvertTo-Json
-InputObject serialized as [{...}] instead of {...}. Endpoints
that set properties on the parsed body (e.g. AddScheduledItem)
reject the array-wrapped payload. [object] keeps #91's array
support while letting single hashtables serialize as objects.

Fixes #100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants