ConvertTo-CMIResultObject
Converts a ManagementBaseObject to an IResultObject.
Syntax
Default (Default)
ConvertTo-CMIResultObject
-InputObject <ManagementBaseObject>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
Description
The ConvertTo-CMIResultObject cmdlet converts a ManagementBaseObject to an IResultObject.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.
Examples
Example 1: Convert a ManagementBaseObject to an IResultObject by passing a WMI object through the pipeline
PS ABC:\> $WmiObject = Get-WmiObject -Query "SELECT * FROM SMS_Site" -Namespace "root\sms\site_PS1"
PS ABC:\> $WmiObject | ConvertTo-CMIResultObject
The first command gets the site object with the code of PS1 and stores the object in the $WmiObject variable.
The second command uses the pipeline operator to pass the site object stored in $WmiObject to ConvertTo-CMIResultObject, which converts the site object to an IResultObject.
Example 2: Convert a ManagementBaseObject to an IResultObject by getting a WMI object
PS ABC:\> $WmiObject = Get-WmiObject -Query "SELECT * FROM SMS_Site" -Namespace "root\sms\site_PS1"
PS ABC:\> ConvertTo-CMIResultObject -InputObject $WmiObject
The first command gets the site object with the code of PS1 and stores the object in the $WmiObject variable.
The second command converts the site object stored in $WmiObject to an IResultObject.
Parameters
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-InputObject
Specifies the ManagementBaseObject to convert to an IResultObject.
Parameter properties
| Type: | ManagementBaseObject |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.