mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
16 lines
471 B
PowerShell
16 lines
471 B
PowerShell
|
|
function ConvertFrom-JsonUTF8()
|
||
|
|
{
|
||
|
|
[CmdletBinding()]
|
||
|
|
param (
|
||
|
|
[parameter(Mandatory = $TRUE, ValueFromPipeline = $TRUE)]
|
||
|
|
$InputObject = $null
|
||
|
|
);
|
||
|
|
|
||
|
|
# We need to properly encode our String to UTF8
|
||
|
|
$ContentBytes = [System.Text.Encoding]::Default.GetBytes($InputObject);
|
||
|
|
$UTF8String = [System.Text.Encoding]::UTF8.GetString($ContentBytes);
|
||
|
|
|
||
|
|
# Return the correct encoded JSON
|
||
|
|
return (ConvertFrom-Json -InputObject $UTF8String);
|
||
|
|
}
|