Skip to content

Instantly share code, notes, and snippets.

@OSDeploy
Last active June 24, 2019 20:07
Show Gist options
  • Save OSDeploy/e51ad0a0198c1ca2df0a98d044f418c3 to your computer and use it in GitHub Desktop.
Save OSDeploy/e51ad0a0198c1ca2df0a98d044f418c3 to your computer and use it in GitHub Desktop.
$MDTRoot = 'D:\MDT'
Add-PSSnapIn Microsoft.BDD.PSSnapIn
New-PSDrive -Name “DS001” -PSProvider MDTProvider -Root $MDTRoot -EA SilentlyContinue
$PackageName = 'Office 2016 64-Bit'
$MDTPackage = "OSDUpdate Package $PackageName"
Import-MDTApplication -Path 'DS001:\Applications' -Enable 'True' `
-Name $MDTPackage -ShortName $MDTPackage `
-CommandLine "PowerShell.exe -ExecutionPolicy Bypass -File "".\Install-OSDUpdatePackage.ps1""" `
-WorkingDirectory ".\Applications\$MDTPackage" -NoSource
New-OSDUpdatePackage -PackageName $PackageName -PackagePath "$MDTRoot\Applications\$MDTPackage"
$PackageName = 'Windows 10 x64 1903'
$MDTPackage = "OSDUpdate Package $PackageName"
Import-MDTApplication -Path 'DS001:\Applications' -Enable 'True' `
-Name $MDTPackage -ShortName $MDTPackage `
-CommandLine "PowerShell.exe -ExecutionPolicy Bypass -File "".\Install-OSDUpdatePackage.ps1""" `
-WorkingDirectory ".\Applications\$MDTPackage" -NoSource
New-OSDUpdatePackage -PackageName $PackageName -PackagePath "$MDTRoot\Applications\$MDTPackage"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment