diff --git a/arm-ttk/ConvertFrom-JSON.ps1 b/arm-ttk/ConvertFrom-JSON.ps1 index 39ef0d35..ce1e73ac 100644 --- a/arm-ttk/ConvertFrom-JSON.ps1 +++ b/arm-ttk/ConvertFrom-JSON.ps1 @@ -45,7 +45,7 @@ process # First, strip block comments $inObj = $_ - $in = if ($InputObject.Contains('*/')) { + $in = if ($InputObject.Contains('*/') -and $InputObject.Contains('/*')) { $JSONBlockComments.Replace($inObj,'') } else { $InputObject diff --git a/arm-ttk/arm-ttk.psm1 b/arm-ttk/arm-ttk.psm1 index 56613ec6..6cab96a2 100644 --- a/arm-ttk/arm-ttk.psm1 +++ b/arm-ttk/arm-ttk.psm1 @@ -1,5 +1,6 @@ #region JSON Functions -if ($PSVersionTable.PSEdition -ne 'Core') { +#powershell 6+ provides support for json with comments +if ($PSVersionTable.PSVersion.Major -lt 6) { . $psScriptRoot\ConvertFrom-Json.ps1 # Overwriting ConvertFrom-JSON to allow for comments within JSON (not on core) }