Skip to content

Commit

Permalink
feat: Export-4bitJSON ( Fixes #80 )
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Oct 16, 2024
1 parent 97f8a13 commit a21438e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Commands/Export-4BitJSON.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
function Export-4BitJSON {
<#
.SYNOPSIS
Exports 4bitcss data to a json file
.DESCRIPTION
Exports 4bitcss data to a json file.
This is simple wrapper of ConvertTo-Json, with support for writing to a file.
#>
param(
# The input object to convert to JSON
[Parameter(ValueFromPipeline)]
[PSObject]
$InputObject,

# The output path.
[string]
$OutputPath
)

process {
$asJson = ConvertTo-Json -Compress -InputObject $InputObject
if ($OutputPath) {
New-Item -Path $outputPath -Force -Value $asJson
} else {
$asJson
}
}
}

0 comments on commit a21438e

Please sign in to comment.