Skip to content

Instantly share code, notes, and snippets.

@sassdawe
Created February 27, 2020 20:26
Show Gist options
  • Save sassdawe/60a7e872356e571e3c8773df3dd234c5 to your computer and use it in GitHub Desktop.
Save sassdawe/60a7e872356e571e3c8773df3dd234c5 to your computer and use it in GitHub Desktop.
Get a content of a small .json file and return an array of PSCusomObject
function Get-JSONContent {
[OutputType([PSCustomObject[]])]
[CmdletBinding()]
param (
[String]
$Path
)
Get-Content -Path $Path -Raw | ConvertFrom-JSON | Foreach-Object { $_ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment