functions/Get-PackageJson.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
function Get-PackageJson { [CmdletBinding()] Param( [Parameter()] [string] $FilePath ) if (-not $FilePath) { $FilePath = (Join-path $PWD.Path 'package.json') } if (Test-Path $FilePath) { (Get-Content -Path $FilePath -Raw | ConvertFrom-Json) } } |