Serializes complex content into PowerShell literals.
ConvertTo-PowerShell.ps1 [[-Value] <Object>] [-Indent <String>] [-IndentBy <String>] [-Newline <String>]
[-SkipInitialIndent] [-Width <UInt16>] [-GenerateKey] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
ConvertTo-PowerShell.ps1 [[-Value] <Object>] [-Indent <String>] [-IndentBy <String>] [-Newline <String>]
[-SkipInitialIndent] [-Width <UInt16>] -SecureKey <SecureString> [-ProgressAction <ActionPreference>]
[<CommonParameters>]
ConvertTo-PowerShell.ps1 [[-Value] <Object>] [-Indent <String>] [-IndentBy <String>] [-Newline <String>]
[-SkipInitialIndent] [-Width <UInt16>] -Credential <PSCredential> [-ProgressAction <ActionPreference>]
[<CommonParameters>]
ConvertTo-PowerShell.ps1 [[-Value] <Object>] [-Indent <String>] [-IndentBy <String>] [-Newline <String>]
[-SkipInitialIndent] [-Width <UInt16>] -KeyBytes <Byte[]> [-ProgressAction <ActionPreference>]
[<CommonParameters>]
4096LMB |ConvertTo-PowerShell.ps1
4LGB
ConvertFrom-Json '[{"a":1,"b":2,"c":{"d":"\/Date(1490216371478)\/","e":null}}]' |ConvertTo-PowerShell.ps1
@( [PSCustomObject]@{ a = 1 b = 2 c = [PSCustomObject]@{ d = [datetime]‘2017-03-22T20:59:31’ e = $null } } )
An array, hash, object, or value type that can be represented as a PowerShell literal.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
The starting indent value. You can probably ignore this.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The string to use for incremental indentation.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The line ending sequence to use.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: [environment]::NewLine
Accept pipeline input: False
Accept wildcard characters: False
Indicates the first line has already been indented. You can probably ignore this.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
The maximum width of string literals.
Type: UInt16
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
Generates a key to use for encrypting credential and secure string literals. If this is omitted, credentials will be encrypted using DPAPI, which will only be decryptable on the same Windows machine where they were encrypted.
Type: SwitchParameter
Parameter Sets: GenerateKey
Aliases: PortableKey
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
The key to use for encrypting credentials and secure strings, as a secure string to be encoded into UTF-8 bytes.
Type: SecureString
Parameter Sets: SecureKey
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A credential containing a password (the username is ignored) to be used for encrypting credentials and secure strings, after encoding to UTF-8 bytes.
Type: PSCredential
Parameter Sets: Credential
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The key to use for encrypting credentials and secure strings, as a byte array.
Type: Byte[]
Parameter Sets: KeyBytes
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.