Skip to content

Instantly share code, notes, and snippets.

@dfranciscus
Created April 27, 2017 17:19
Show Gist options
  • Save dfranciscus/11a2faee53716f3286c82dbe2e73eeb6 to your computer and use it in GitHub Desktop.
Save dfranciscus/11a2faee53716f3286c82dbe2e73eeb6 to your computer and use it in GitHub Desktop.
Add-PSSnapin Microsoft.BDD.PSSnapIn
New-PSDrive -Name "MDT" -PSProvider "MDTProvider" -Root "E:\MDT"
$NuGetPackages = choco list --source=nugetserver.domain.com
ForEach ($NugetPkg in $NuGetPackages)
{
$PackageName = $NugetPkg.Split('|')[0]
$Version = $NugetPkg.Split('|')[1]
Import-MDTApplication -Path 'MDT:\Applications\test' -Name $PackageName -NoSource -Commandline "choco install $PackageName -y" -Shortname $PackageName -Version $Version -Enable "True"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment