-
Notifications
You must be signed in to change notification settings - Fork 9
ConvertTo CimInstance
Converts a hashtable into a CimInstance array.
ConvertTo-CimInstance [-Hashtable] <Hashtable> [[-ClassName] <String>] [[-Namespace] <String>]
[<CommonParameters>]
This function is used to convert a hashtable into MSFT_KeyValuePair objects. These are stored as an CimInstance array. DSC cannot handle hashtables but CimInstances arrays storing MSFT_KeyValuePair.
ConvertTo-CimInstance -Hashtable @{
String = 'a string'
Bool = $true
Int = 99
Array = 'a, b, c'
}
This example returns an CimInstance with the provided hashtable values.
The ClassName of the CimInstance to create.
Default value is to 'MSFT_KeyValuePair'.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: MSFT_KeyValuePair
Accept pipeline input: False
Accept wildcard characters: False
A hashtable with the values to convert.
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
The Namespace of the CimInstance to create.
Default value is to 'root/microsoft/Windows/DesiredStateConfiguration'.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: Root/microsoft/Windows/DesiredStateConfiguration
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