This section describes the Import-MDTOperatingSystem Windows PowerShell cmdlet. Run this cmdlet from a Windows PowerShell console that has the MDT PowerShell snap-in loaded. For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see Loading the MDT Windows PowerShell Snap-In.

Syntax

Import-MDTOperatingSystem [-Path <String>] -SourcePath <String> [-DestinationFolder <String>] [-Move] [<CommonParameters>]

–or–

Import-MDTOperatingSystem [-Path <String>] [‑DestinationFolder <String>] -SourceFile <String> [‑SetupPath <String>] [-Move] [<CommonParameters>]

–or–

Import-MDTOperatingSystem [-Path <String>] -WDSServer <String> [<CommonParameters>]

Description

This cmdlet imports an operating system into a deployment share. The following operating system types can be imported using this cmdlet:

·     Operating systems from the original source files, using the SourcePath parameters. The first syntax example illustrates the use of this cmdlet for this type of operating system import.

·     Custom operating systems image files, such as capture images from reference computers, using the SourceFile parameter. The second syntax example illustrates the use of this cmdlet for this type of operating system import.

·     Operating system images that are present in Windows Deployment Services using the WDSServer parameter. The last syntax example illustrates the use of this cmdlet for this type of operating system import.

Parameters

This subsection provides information about the various parameters that can be used with the Import-MDTOperatingSystem cmdlet.

-Path <String>

This parameter specifies the fully qualified path to an existing folder within the deployment share where the operating system being imported will be placed. If the DestinationFolder parameter is used, then the folder specified in the DestinationFolder parameter is created beneath the folder specified in this parameter. This parameter is used in all syntax usages for this cmdlet.

Note   If this parameter is not provided, then the Windows PowerShell working directory must default to the desired location within the deployment share.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-SourcePath <String>

This parameter specifies the fully qualified path to the operating system source files for the operating system that will be imported into the deployment share. This parameter is only valid for use in the first syntax example.

 

Parameter

Value

Required?

True

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-DestinationFolder <String>

This parameter specifies the folder in the deployment share where the operating system source files are to be imported. This folder is created beneath the folder specified in the Path parameter. This parameter is only valid for use in the first and second syntax examples.

 

Parameter

Value

Required?

True

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-Move [<SwitchParameter>]

This parameter specifies if the operating system source files should be moved (instead of copied) from the folder where the operating system source files are located, which is specified in the DestinationFolder parameter.

If this parameter is:

·     Specified, then the files are moved and the files in the folder specified in the DestinationFolder parameter are deleted

·     Not specified, then the files are copied and the files in the folder specified in the DestinationFolder parameter are retained

This parameter is only valid for use in the first and second syntax examples.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-SourceFile <String>

This parameter specifies the fully qualified path to the operating system source .wim file for the operating system that will be imported into the deployment share. This parameter is only valid for use in the second syntax example.

 

Parameter

Value

Required?

True

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-SetupPath <String>

This parameter specifies the fully qualified path to the operating system setup files that need to be imported along with the .wim file specified in the SourceFile parameter. This parameter is only necessary for Windows Vista or later operating system images. This parameter is only valid for use in the second syntax example.

 

Parameter

Value

Required?

True

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-WDSServer <String>

This parameter specifies the name of the Windows Deployment Services server on which the operating system image files to be imported are located. All operating image files on the Windows Deployment Services server will be imported into the deployment share. The actual operating system image files are not copied to the deployment share. Instead, the deployment share contains a link to each operating system file on the Windows Deployment Services server.

This parameter is only valid for use in the last syntax example.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

<CommonParameters>

This cmdlet supports the following common parameters: Verbose, Debug, ErrorAction, ErrorVariable, OutBuffer, OutVariable, WarningAction, and WarningVariable. For more information, see the topic, “about_CommonParameters,” which you can access by typing the following command, and then pressing ENTER:

Get-Help about_CommonParameters

Outputs

This cmdlet outputs one or more PSObject type objects (one for each operating system that was imported).

Example 1

Import-MDTOperatingSystem -Path "DS001:\Operating Systems" ‑SourcePath "\\WDG‑MDT‑01\Source$\Windows8" ‑DestinationFolder "Windows8x64"

Description

This example imports an operating system from the network shared folder at \\WDG-MDT-01\Source$\Windows8 and copies the source files to DS001:\Operating Systems\Windows8x64 within the deployment share. The source files are retained.

Example 2

Import-MDTOperatingSystem -Path "DS001:\Operating Systems" ‑SourcePath "\\WDG‑MDT‑01\Source$\Windows8" ‑DestinationFolder "Windows8x64" -Move

Description

This example imports an operating system from the network shared folder at \\WDG-MDT-01\Source$\Windows8 and copies the source files to DS001:\Operating Systems\Windows8x64 within the deployment share. The source files are removed from the network shared folder at \\WDG-MDT-01\Source$\Windows8.

Example 3

Import-MDTOperatingSystem -Path "DS001:\Operating Systems" ‑DestinationFolder "Windows8x64-Reference" –SourceFile "\\WDG‑MDT‑01\Capture$\WDG-REF-01_Capture.wim"

Description

This example imports an operating system captured, custom image file (.wim file) from \\WDG-MDT-01\ Capture$\WDG-REF-01_Capture.wim and copies the image file to DS001:\Operating Systems\Windows8x64-Reference within the deployment share. The source .wim file is retained on the network shared folder.

Example 4

Import-MDTOperatingSystem -Path "DS001:\Operating Systems" ‑WDSServer "WDG-WDS-01"

Description

This example imports all the operating system images from the Windows Deployment Services server named WDG-WDS-01 and creates a link to each operating system image in DS001:\Operating Systems within the deployment share. The source operating system image files on the Windows Deployment Services server are retained on the Windows Deployment Services server.

Related Topics

MDT Windows PowerShell Cmdlets