This section describes the Import-MDTPackage 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-MDTPackage [-Path <String>] [[-SourcePath] <String[]>] [<CommonParameters>]

Description

This cmdlet imports one or more operating system packages into a deployment share. The types of operating system packages that can be imported include security updates, language packs, or new components. Service packs should not be imported as operating system packages as they cannot be installed offline.

Parameters

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

-Path <String>

This parameter specifies the fully qualified path to an existing folder within the deployment share where the operating system packages being imported will be placed.

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 a folder structure to be scanned for operating system packages to import. The specified folder structure will be scanned for .cab and .msu files. For .msu files, the .cab files inside the .msu files are automatically extracted.

 

Parameter

Value

Required?

True

Position?

1 and 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 a PSObject type object that references the package just imported.

Example 1

Import-MDTOperatingSystem -Path "DS001:\Packages" ‑SourcePath "\\WDG‑MDT‑01\Source$\OSPackages"

Description

This example scans network shared folder at \\WDG-MDT-01\Source$\OSPackages for operating system packages and copies the source files to DS001:\Packages folder within the deployment share. The source files are removed from the network shared folder at \\WDG-MDT-01\Source$\OSPackages.

Related Topics

MDT Windows PowerShell Cmdlets