ConvertTo-CMIResultObject
Converts a ManagementBaseObject to an IResultObject.
Syntax
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.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Specifies the ManagementBaseObject to convert to an IResultObject.
Type: | ManagementBaseObject |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
System.Management.ManagementBaseObject
Outputs
System.Object