Closed Konverto-MartinGasser closed 1 year ago
Hmm I run into the same error when I test on Windows PowerShell (we should make a job for this).
if ($PsCmdlet.ParameterSetName -eq "Pipeline") {
if ($PSVersionTable.PSEdition -ne "Core") {
$AnalyticsRuleTemplate = $FullARM | ConvertFrom-Json -Verbose
} else {
$AnalyticsRuleTemplate = $FullARM | ConvertFrom-Json -Depth 99
}
} else {
Write-Verbose "Read file `"$Filename`""
if ($PSVersionTable.PSEdition -ne "Core") {
$AnalyticsRuleTemplate = Get-Content $Filename | ConvertFrom-Json -Verbose
} else {
$AnalyticsRuleTemplate = Get-Content $Filename | ConvertFrom-Json -Depth 99 -Verbose
}
}
Should fix it :), when I test with this it works for me.
Opened #19
Fixed version is now available on the PowerShell Gallery https://www.powershellgallery.com/packages/SentinelARConverter/2.0.2
Prerequisites
Steps to reproduce
Using PowerShell < v6.2 the conversation is failing with error "Could not convert source file. JSON might be corrupted", since the -Depth parameter for ConvertFrom-Json is only available since PS v6.2. The conversation is working correctly when removing the parameter.
Trusting the answer of mklement0 the parameter could be removed since the default depth level is set to 1024.
Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
No response