About two weeks ago I was finishing up writing an upcoming PowerShell book together with fellow MVP Mikael Nystrom. During the book development process we ran into having to configure a MDT deployment share, and since it's a PowerShell book, of course we wanted to do it in PowerShell. So, here is how.
Creating a MDT Deployment Share
To configure/modify a deployment share, you need to have one. I already posted an article on that part, so please use this script to create one:
Creating the MDT Deployment share using PowerShell
Configuring a MDT Deployment Share
The script in the previous section creates a deployment share in the C:\MDTProduction\DS folder. Here is how it looks when opened in Deployment Workbench:
Now, I wanted to configure the settings of my deployment share. To do that you use the Set-ItemProperty, like this:
# Connect to the MDT Production Deployment Share Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1" new-PSDrive -Name "DS002" -PSProvider "MDTProvider" -Root "C:\MDTProductionDS" #Configure DeploymentShare Set-ItemProperty -Path DS002: -Name SupportX86 -Value 'False' Set-ItemProperty -Path DS002: -Name Boot.x64.ScratchSpace -Value '512' Set-ItemProperty -Path DS002: -Name Boot.x64.IncludeAllDrivers -Value 'True' Set-ItemProperty -Path DS002: -Name Boot.x64.SelectionProfile -Value 'WinPE x64' Set-ItemProperty -Path DS002: -Name Boot.x64.LiteTouchWIMDescription -Value 'MDT Production x64' Set-ItemProperty -Path DS002: -Name Boot.x64.LiteTouchISOName -Value 'MDT Production x64.iso'
After running the above PowerShell script, here is the updated deployment share settings.
If you want to enumerate the settings, you can use the Get-ItemProperty.
New-PSDrive -Name "DS002" -PSProvider MDTProvider -Root "C:\MDTProductionDS" Get-ItemProperty DS002:
You can of course also create an object and use that:
$MDTSettings = Get-ItemProperty DS002: $MDTSettings | Select *