-
Notifications
You must be signed in to change notification settings - Fork 0
Convert EmMgJsonToFlatObject
external help file: MemPolicyManager-help.xml Module Name: MemPolicyManager online version: https://criticalsolutionsnetwork.github.io/MemPolicyManager/#Convert-EmMgJsonToFlatObject schema: 2.0.0
Converts a JSON string or file to a flat PowerShell object.
Convert-EmMgJsonToFlatObject -ImportPath <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]
Convert-EmMgJsonToFlatObject -JSON <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]
The Convert-EmMgJsonToFlatObject cmdlet takes a JSON string or a path to a JSON file and converts it into a flat PowerShell object. The cmdlet supports importing JSON from a file or directly from a string provided in the pipeline.
Convert-EmMgJsonToFlatObject -ImportPath "C:\path\to\file.json"
This example imports the JSON file from the specified path and converts it to a flat PowerShell object.
'{"name": "Test", "value": {"nested": 123}}' | Convert-EmMgJsonToFlatObject
This example takes a JSON string from the pipeline, converts it to a flat PowerShell object, and outputs the result.
The path to the JSON file to be imported. This parameter is mandatory when using the 'Import' parameter set.
Type: String
Parameter Sets: Import
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseThe JSON string to be converted to a flat object. This parameter is mandatory when using the 'StringObject' parameter set.
Type: String
Parameter Sets: StringObject
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
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.
The cmdlet uses the ConvertTo-FlatObject function to flatten the JSON structure. The cmdlet supports two parameter sets: 'Import' for importing JSON from a file and 'StringObject' for converting JSON strings. Borrowed private function code from: https://powersnippets.com/convertto-flatobject/
https://criticalsolutionsnetwork.github.io/MemPolicyManager/#Convert-EmMgJsonToFlatObject