Ok here we go Here is my current Driver Repository folder structure. Within it there are multiple makes & models. For this example i'm only going to narrow it down to just one vendor. Code: D:\DriverStore D:\DriverStore\Windows 7 x64 D:\DriverStore\Windows 7 x64\Dell Inc D:\DriverStore\Windows 7 x64\Dell Inc\Optiplex 780 D:\DriverStore\Windows 7 x86 D:\DriverStore\Windows 7 x86\Dell Inc D:\DriverStore\Windows 7 x86\Dell Inc\Optiplex 760 D:\DriverStore\Windows 8 x64 D:\DriverStore\Windows 8 x64\Dell Inc D:\DriverStore\Windows 8 x64\Dell Inc\Optiplex 3010 D:\DriverStore\Windows 8 x86 D:\DriverStore\Windows 8 x86\Dell Inc D:\DriverStore\Windows 8 x86\Dell Inc\Optiplex 3020 D:\DriverStore\Windows 8.1 x64 D:\DriverStore\Windows 8.1 x64\Dell Inc D:\DriverStore\Windows 8.1 x64\Dell Inc\Optiplex 9020 AIO D:\DriverStore\Windows 8.1 x86 D:\DriverStore\Windows 8.1 x86\Dell Inc D:\DriverStore\Windows 8.1 x86\Dell Inc\Tablet 5130 I need a script that will convert the folder structure above to this D:\DriverStore\$OS\$Make\$Model and then execute the following powershell script; Current powershell command to create driver selection profiles Code: Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1" New-PSDrive -Name "DS001" -PSProvider MDTProvider -Root "E:\DeploymentShare" new-item -path "DS001:\Selection Profiles" -enable "True" -Name "Drivers - Windows 7 x64 - Dell Inc - Optiplex 380" -Comments "" -Definition "<SelectionProfile><Include path=`"Out-of-Box Drivers\Windows 7 x64\Dell Inc\Optiplex 380`" /></SelectionProfile>" -ReadOnly "False" -Verbose Command I would like to use based on variables Code: Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1" New-PSDrive -Name "DS001" -PSProvider MDTProvider -Root "E:\DeploymentShare" new-item -path "DS001:\Selection Profiles" -enable "True" -Name "Drivers - $OS - $MAKE - $MODEL" -Comments "" -Definition "<SelectionProfile><Include path=`"Out-of-Box Drivers\$OS\$MAKE\$MODEL`" /></SelectionProfile>" -ReadOnly "False" -Verbose Code: ::=============================================================================================================== :: Path to Windows 7 x64 Make & Model Driver Store set drivers1=d:\driverstore\Windows 7 x64 :: Path to Windows 8 x64 Make & Model Driver Store set drivers2=d:\driverstore\Windows 7 x86 :: Path to Windows 8 x64 Make & Model Driver Store set drivers3=d:\driverstore\Windows 8 x64 :: Path to Windows 8 x86 Make & Model Driver Store set drivers4=d:\driverstore\Windows 8 x86 :: Path to Windows 8.1 x64 Make & Model Driver Store set drivers5=d:\driverstore\Windows 8.1 x64 :: Path to Windows 8.1 x86 Make & Model Driver Store set drivers6=d:\driverstore\Windows 8.1 x86 ::===============================================================================================================
This has been resolved now. I used regular command line prompt. Just need to clean up the code some more.