21 lines
482 B
PowerShell
21 lines
482 B
PowerShell
function Get-JsonStringLeadsByDepth {
|
|
<#
|
|
.SYNOPSIS
|
|
Returns the indented or leftdented spaces for the level, in that order
|
|
|
|
.OUTPUTS
|
|
[$spacesString, $shortSpacesString]
|
|
[Indented string, Leftdented string]
|
|
#>
|
|
param (
|
|
$Depth = 0
|
|
)
|
|
|
|
$spacesString = [string]::new(" ", ($Depth + 1) * 2)
|
|
$shortSpacesString = ""
|
|
if ($Depth -gt 0) {
|
|
$shortSpacesString = [string]::new(" ", $Depth * 2)
|
|
}
|
|
|
|
return ($spacesString, $shortSpacesString)
|
|
} |