ps/Modules/Cole.PowerShell.Developer/Public/Write-JsonNamePrimitiveValuePair.ps1

16 lines
418 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
function Write-JsonNamePrimitiveValuePair {
<#
.SYNOPSIS
Used to write the value for primitive pairs to a Json object
#>
param (
$JsonName,
$JsonValue,
$Depth = 0,
[switch]$OrderedKeys
)
$spacesString, $shortSpacesString = (Get-JsonStringLeadsByDepth -Depth $Depth)
return ('{0}"{1}" : {2},' -f $shortSpacesString, $JsonName, $JsonValue.ToString().ToLower())
}