ImagePathcher.ps1: You cannot call a method on a null-valued expression

In my environments, I use MDT and/or WDS in many cases. Here is always the problem of updating images, because it takes a lot of time. For this reason, I was looking for a script, which would do the same work as I, but without losing my time.
Imagepatcher PowerShell script from CodePlex ( was the perfect solution for me, but not in the last months. I think that the problem occurred after I upgraded my environment to Windows Server 2012, but I am not sure. Anyway, when I tried to execute the script, I received the error that there is something wrong with the saving of downloaded files. I analyzed the script and found that something is not working properly when combining the name from few variables.
I repaired the issue and you can download the new imagepatcher.ps1 from here. (36.63 kb).

Recommended Reading

Comments Icon2 comments found on “ImagePathcher.ps1: You cannot call a method on a null-valued expression

  1. Hope this helped? Oh man you saved me! I was gtinteg this same error and kept thinking WTH is this name’ it keeps talking about!?!?! Finally did a web search, read your post, and thought Duh Thanks man!


Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.