Convert​To-​CM​IResult​Object

Converts a ManagementBaseObject to an IResultObject .

Syntax

ConvertTo-CMIResultObject
         [-DisableWildcardHandling]
         [-ForceWildcardHandling]
         -InputObject <ManagementBaseObject>
         [<CommonParameters>]

Description

The ConvertTo-CMIResultObject cmdlet converts a ManagementBaseObject to an IResultObject.

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.

Required Parameters

-InputObject

Specifies the ManagementBaseObject to convert to an IResultObject.

Type:ManagementBaseObject
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False