ps/Modules/Cole.PowerShell.Developer/Public/Get-JsonStringLeadsByDepth.ps1

21 lines
482 B
PowerShell
Raw Permalink Normal View History

2023-05-30 22:51:22 -07:00
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)
}