chore: updated for ACSC hardening
This commit is contained in:
@ -1,25 +1,25 @@
|
||||
param (
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$jsonfile,
|
||||
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$export
|
||||
|
||||
)
|
||||
|
||||
# Read the original JSON data from the file
|
||||
$JsonData = Get-Content -Path $jsonfile -Raw
|
||||
|
||||
# Convert JSON string to a PowerShell object
|
||||
$JsonObject = $JsonData | ConvertFrom-Json
|
||||
|
||||
# Convert back to JSON with indentation and formatting
|
||||
$FormattedJson = $JsonObject | ConvertTo-Json -Depth 10
|
||||
|
||||
# Write the formatted JSON string to the output file
|
||||
Set-Content -Path $export -Value $FormattedJson
|
||||
|
||||
remove-item $jsonfile -Force -Verbose
|
||||
|
||||
Write-Host "✅ JSON reformatted with line breaks and saved to: $export"
|
||||
|
||||
param (
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$jsonfile,
|
||||
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$export
|
||||
|
||||
)
|
||||
|
||||
# Read the original JSON data from the file
|
||||
$JsonData = Get-Content -Path $jsonfile -Raw
|
||||
|
||||
# Convert JSON string to a PowerShell object
|
||||
$JsonObject = $JsonData | ConvertFrom-Json
|
||||
|
||||
# Convert back to JSON with indentation and formatting
|
||||
$FormattedJson = $JsonObject | ConvertTo-Json -Depth 10
|
||||
|
||||
# Write the formatted JSON string to the output file
|
||||
Set-Content -Path $export -Value $FormattedJson
|
||||
|
||||
remove-item $jsonfile -Force -Verbose
|
||||
|
||||
Write-Host "✅ JSON reformatted with line breaks and saved to: $export"
|
||||
|
||||
|
Reference in New Issue
Block a user