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

Description

This cmdlet imports one or more device drivers into a deployment share. This cmdlet searches for device drivers starting at the folder specified in the SourcePath parameter. This cmdlet will locate multiple device drivers found in that folder structure.

Parameters

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

-Path <String>

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

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

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-SourcePath <String[ ]>

This parameter specifies one or more fully qualified paths in a string array for the source folders where the device driver files are located. Each folder structure, starting with the folder specified in this parameter, is searched for device drivers, including all subfolders and the contents of .cab files in the folder structure.

Note   If this parameter is not provided, then the Windows PowerShell working directory must default to the folder where the device driver files are located. This parameter must be provided if the Path parameter is not provided.

 

Parameter

Value

Required?

True

Position?

1 and Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-ImportDuplicates [<SwitchParameter>]

This parameter specifies whether this cmdlet should import duplicate device drivers. By default, duplicate device drivers are not imported. Duplicate device drivers are detected by calculating a hash values for all the files in a device driver folder. If the calculated hash value matches another device driver, the device driver to be imported is considered a duplicate.

If a duplicate driver is detected and this parameter is not provided, the device driver will be added and linked to the original, existing device driver.

If this parameter is:

·     Specified, then the duplicate device drivers are imported

·     Not specified, then the device drivers will be added and linked to the original, existing device drivers

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

True (ByValue)

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 device driver imported).

Example 1

Import-MDTDriver -Path
"DS001:\Out-of-Box Drivers" ‑SourcePath "\\WDG-MDT-01\Source$\Drivers"

Description

This example imports all device drivers in the folders structure with the root of the folder structure at \\WDG-MDT-01\Source$\Drivers. The device drivers are stored in the Out-of-Box Drivers folder in the deployment share that is mapped to the DS001: MDTProvder Windows PowerShell drive. If any duplicate device drivers are detected, the device drivers will be added and linked to the original, existing device drivers in the deployment share.

Example 2

$DriverSourcePath="\\WDG-MDT-01\Source$\VendorADrivers", "\\WDG-MDT-01\Source$\VendorBDrivers"

Import-MDTDriver -Path "DS001:\Out-of-Box Drivers" ‑SourcePath $DriverSourcePath ‑ImportDuplicates

Description

This example imports all device drivers in the folders structure specified in the string array $DriverSourcePath. The device drivers are stored in the Out-of-Box Drivers folder in the deployment share that is mapped to the DS001: MDTProvder Windows PowerShell drive. If any duplicate device drivers are detected, the duplicate device drivers are imported.

Related Topics

MDT Windows PowerShell Cmdlets