ConvertFrom‑DscResourceInstance - dsccommunity/DscResource.Common GitHub Wiki
Convert any object to hashtable.
ConvertFrom-DscResourceInstance [-InputObject] <PSObject> [[-OutputFormat] <String>]
[<CommonParameters>]
This function is used to convert a PSObject into a hashtable.
$object = [PSCustomObject] = @{
FirstName = 'John'
LastName = 'Smith'
}
ConvertFrom-DscResourceInstance -InputObject $object
This creates a PSCustomObject and converts its properties and values to key/value pairs in a hashtable.
$objectArray = [PSCustomObject] = @{
FirstName = 'John'
LastName = 'Smith'
}, [PSCustomObject] = @{
FirstName = 'Peter'
LastName = 'Smith'
}
$objectArray | ConvertFrom-DscResourceInstance
This creates an array of PSCustomObject and converts their properties and values to key/value pairs in a hashtable.
The object that should be convert to hashtable.
Type: PSObject
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Set the format you do want to convert the object. The default value is HashTable. It's the only value accepted at this time.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: HashTable
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.