Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion module/Public/New-nbObject.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,7 @@ function New-nbObject {
}
$mapObject = New-Object -TypeName psobject -Property $mapObject

Invoke-nbApi -Resource $Resource -HttpVerb POST -Body ($mapObject | ConvertTo-Json -Compress)
$jsondata=($mapObject | ConvertTo-Json)
#Issues with International Characters like German Umlaut -> so [System.Text.Encoding]::UTF8
Invoke-nbApi -Resource $Resource -HttpVerb POST -Body ([System.Text.Encoding]::UTF8.GetBytes($jsondata))
}
7 changes: 5 additions & 2 deletions module/Public/Set-nbObject.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,13 @@ function Set-nbObject {
}
}
$mapObject = New-Object -TypeName psobject -Property $mapObject
$jsondata=($mapObject | ConvertTo-Json)
if ($Patch.IsPresent) {
#$notChanged = $mapObject | compare-object -ReferenceObject $OldObject -ExcludeDifferent -PassThru
#$mapObject = $mapObject | Select-Object -ExcludeProperty $notChanged
return Invoke-nbApi -Resource $Resource/$id -HttpVerb Patch -Body ($mapObject | ConvertTo-Json)
#Issues with International Characters like German Umlaut -> so [System.Text.Encoding]::UTF8
return Invoke-nbApi -Resource $Resource/$id -HttpVerb Patch -Body ([System.Text.Encoding]::UTF8.GetBytes($jsondata))
}
return Invoke-nbApi -Resource $Resource/$id -HttpVerb Put -Body ($mapObject | ConvertTo-Json)
#Issues with International Characters like German Umlaut -> so [System.Text.Encoding]::UTF8
return Invoke-nbApi -Resource $Resource/$id -HttpVerb Put -Body ([System.Text.Encoding]::UTF8.GetBytes($jsondata))
}