Skip to content

Instantly share code, notes, and snippets.

@dfranciscus
Created April 27, 2017 17:34
Show Gist options
  • Save dfranciscus/f6bb86f5c12c37fefcaffbce492f2ce7 to your computer and use it in GitHub Desktop.
Save dfranciscus/f6bb86f5c12c37fefcaffbce492f2ce7 to your computer and use it in GitHub Desktop.
Add-PSSnapin Microsoft.BDD.PSSnapIn
New-PSDrive -Name "MDT" -PSProvider "MDTProvider" -Root "E:\MDT"
$NuGetServer = 'nugetserver'
$NuGetPackages = choco list --source=$NuGetServer -r
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 --source=$NuGetServer -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