From 52df964c69dd98b3f853f528bbd8b9d2ad048c8d Mon Sep 17 00:00:00 2001 From: James Brundage <@github.com> Date: Mon, 29 Apr 2024 10:52:49 -0700 Subject: [PATCH] fix: Send-HueBridge ContentType ( Fixes #116 ) --- Commands/Hue/Send-HueBridge.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Commands/Hue/Send-HueBridge.ps1 b/Commands/Hue/Send-HueBridge.ps1 index e7dc603..5e3184e 100644 --- a/Commands/Hue/Send-HueBridge.ps1 +++ b/Commands/Hue/Send-HueBridge.ps1 @@ -88,6 +88,9 @@ function Send-HueBridge #region Invoke-RestMethod and decorate resultsa Write-Verbose "Sending command to $($splat.Uri)" + if ($splat.Method -ne 'GET' -and -not $splat.ContentType) { + $splat.ContentType = 'application/json' + } $invokeResult = Invoke-RestMethod @splat 2>&1 # Always add a HueUserName and IPAddress to each result $userNameNoteProperty = [PSNoteProperty]::new('HueUserName', $HueUserName)