Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have over 10 hyper-v images that I use for testing various projects. Some I use often some less so.

It is a lot of work starting each of the machines individually to run windows update.

I was wondering if there is a powershell script that could spin up each of the machines, run windows update on it and then close it down again?

share|improve this question
up vote 3 down vote accepted

If your VMs only include recent (Vista or later) Windows system, you don't need to actually start them to apply updates; you can do it directly to the offline .VHD files, by mounting them and using the dism.exe offline servicing tool; dism.exe has several features, one of which is the ability to apply patches to an offline Windows image or VHD file.

This very nice script should be able to automatically mount a VHD file, apply some updates to it and unmount it; I've not personally tested it, but looks like it should work:

share|improve this answer

Not that I am aware of. This functionality is built into SCVMM, a non-free produce MS sells.

You might be able to do some sort of homebrew script (if I remember tomorrow I've got scripts for doing some other maintenance similar to this and will post them).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.