Powershell – VCRedist automagic

So a good friend of mine Mikael Nyström wrote this awesome script about Always needing the VC++ Redist editions for when he makes reference images. The post can be read in full here http://deploymentbunny.com – Powershell is king.

That got me to thinking since we all build our ref images in MDT anyway and MDT is powershell based would it be possible to download the needed files, import them as applications and cleanup the downloaded files after. Well as you might have guess yes you can.

I’ve shamlessly copied mikes nice script and added some features so you can Point to your deploymentshare and choose if you want to cleanup after the download and import is done.

Updates script file and xml file can be downloaded from here Script files

Feel free to checkout the script and if you have already tried Mikes script there are 3 new paramters that can be set
– MDTPowershell, this needs to Point to the powershell commandfile that mdt has (no need to use this if your mdt application installation is in the default Place

– MDTRoot, this needs to be set to the deploymentshare where you want the applications imported. Default is C:\DeploymentShare

-CleanUp, This is by default False and can be set to true in wich case it removes all the downloaded files at the end of the script.

As a last note the XML file has been updateded with a new value that for each application/file that is beeing downloaded there is a section called <MDTCommandLine> this should contain any commandline switches that is needed to make the application install silently.

Do Enjoy

Advertisements

2 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s