-
Notifications
You must be signed in to change notification settings - Fork 0
Select Json
external help file: JSONLab-help.xml Module Name: JSONLab online version: https://www.rfc-editor.org/rfc/rfc6901 schema: 2.0.0
Returns a value from a JSON string or file.
Select-Json [[-JsonPointer] <String>] [-InputObject <Object>] [-FollowReferences]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Select-Json [[-JsonPointer] <String>] -Path <String> [-FollowReferences] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
{{ Fill in the Description }}
'true' |Select-Json # default selection is entire parsed JSON document
True
'{"":3.14}' |Select-Json /
3.14
Select-Json /powershell.codeFormatting.preset -Path ./.vscode/settings.json
Allman
'{"a":1, "b": {"ZZ/ZZ": {"AD~BC": 7}}}' |Select-Json /b/ZZ~1ZZ
Name Value
AD~BC 7
'{"a":1, "b": {"ZZ/ZZ": {"AD~BC": 7}}}' |ConvertFrom-Json |Select-Json /b/ZZ~1ZZ
7
'{"a":1, "b": {"ZZ/ZZ": {"AD~BC": 7}}}' |Select-Json /b/ZZ~1ZZ |ConvertTo-Json -Compress
{"AD~BC":7}
'{d:{a:{b:1,c:{"$ref":"#/d/c"}},c:{d:{"$ref":"#/d/two"}},two:2}}' |Select-Json /*/a/c/* -FollowReferences
2
Resolve-Path $env:LOCALAPPDATA/Packages/*WindowsTerminal*/LocalState/settings.json |Get-Item |Get-Content -Raw |Select-Json /profiles/list/*/name
PowerShell Windows PowerShell Ubuntu F# Interactive F# REPL C# REPL Command Prompt Media Server (ssh) Azure Cloud Shell Developer Command Prompt for VS 2022 Developer PowerShell for VS 2022
The full path name of the property to get, as a JSON Pointer, modified to support wildcards: ~0 = ~ ~1 = / ~2 = ? ~3 = * ~4 = [
Type: String
Parameter Sets: (All)
Aliases: Name
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe JSON (string or parsed object/hashtable) to get the value from.
Type: Object
Parameter Sets: InputObject
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseA JSON file to update.
Type: String
Parameter Sets: Path
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIndicates that references should be followed.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: FollowRefs, References
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.