Convert​To-​FI​MResource

Deserializes FIMResource objects from the given file.

Syntax

ConvertTo-FIMResource
         [-Confirm]
         [-File <String>]
         [-WhatIf]

Description

The ConvertTo-FIMResource cmdlet deserializes XML resources used elsewhere in themmseeWindows PowerShellâ„¢ cmdlet set. The cmdlet returns ExportObject, ImportObject, and MatchObjects. This is the complement cmdlet to the ConvertFrom-FIMResource cmdlet.

The cmdlet deserializes the objects by usingXmlObjectSerializerin Windows .NET.

To help distinguish ConvertTo-FIMResource from ConvertFrom-FIMResource, remember that you are converting to FIM resources from a file.

Examples

Example 1: Deserialize an ExportObject

$Pilot =  ConvertTo-FIMResource  -File pilot.xml $Matches =  Join-FIMConfig  -Source $Pilot -Target $Production -defaultJoin "DisplayName"

This command shows how you can deserialize ExportObject instances that were serialized on another system. The command stores the result to the variable named $Pilot.

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-File

Specifies the filename that this cmdlet deserializes.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

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

Inputs

None

This cmdlet takes no input.

Outputs

FIMResource

The return type could be ImportObject[], ExportObject[], or MatchObject[], depending on which type is stored in the file. You only get back homogeneous types from this deserialization.