-
Notifications
You must be signed in to change notification settings - Fork 9
ConvertFrom DscResourceInstance
dscbot edited this page Feb 13, 2024
·
2 revisions
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.
- Assert-BoundParameter
- Assert-ElevatedUser
- Assert-IPAddress
- Assert-Module
- Compare-DscParameterState
- Compare-ResourcePropertyState
- ConvertFrom-DscResourceInstance
- ConvertTo-CimInstance
- ConvertTo-HashTable
- Find-Certificate
- Get-ComputerName
- Get-DscProperty
- Get-EnvironmentVariable
- Get-LocalizedData
- Get-LocalizedDataForInvariantCulture
- Get-PSModulePath
- Get-TemporaryFolder
- Get-UserName
- New-ArgumentException
- New-ErrorRecord
- New-Exception
- New-InvalidDataException
- New-InvalidOperationException
- New-InvalidResultException
- New-NotImplementedException
- New-ObjectNotFoundException
- Remove-CommonParameter
- Set-DscMachineRebootRequired
- Set-PSModulePath
- Test-AccountRequirePassword
- Test-DscParameterState
- Test-DscProperty
- Test-IsNanoServer
- Test-IsNumericType
- Test-ModuleExist