-
Notifications
You must be signed in to change notification settings - Fork 0
Convert EmMgJsonToClass
external help file: MemPolicyManager-help.xml Module Name: MemPolicyManager online version: https://criticalsolutionsnetwork.github.io/MemPolicyManager/#Convert-EmMgJsonToClass schema: 2.0.0
Converts a JSON string to a PowerShell class definition.
Convert-EmMgJsonToClass [-Json] <String> [-ClassName] <String> [-Operation] <String>
[-ProgressAction <ActionPreference>] [<CommonParameters>]
The Convert-EmMgJsonToClass cmdlet takes a JSON string and a class name as input and generates a PowerShell class definition. The cmdlet supports different operations (create, update, get) to customize the generated class properties and constructors.
$json = '{"name": "Test", "value": 123}'
PS> Convert-EmMgJsonToClass -Json $json -ClassName "TestClass" -Operation "create"
This example converts the JSON string into a PowerShell class named "TestClass" for the "create" operation.
The JSON string to be converted into a PowerShell class. This parameter is mandatory.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe name of the class to be generated. This parameter is mandatory.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe operation type to customize the generated class. Valid values are "create", "update", and "get". This parameter is mandatory.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
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.
The cmdlet generates a PowerShell class with properties, a default constructor, and a parameterized constructor based on the JSON string. The cmdlet uses different operations to customize the class properties and constructors.
https://criticalsolutionsnetwork.github.io/MemPolicyManager/#Convert-EmMgJsonToClass