This project is read-only.

Imagepatcher breaks with ADK instead of WAIK, required for SCCM 2012 SP1.

Apr 3, 2013 at 11:14 AM
I've tried my hand at getting the script to work using the ADK, but I must be missing a few places in the script where stuff is getting called. Running the powershell_ise as "administrator" still fails the admin check on windows 8. Would the debug log help in this instance?

I've been using your script for years now, and all I can say is thank you for the hours you have saved me.
Apr 3, 2013 at 12:40 PM
surely any errors would help. the guy who wrote the script indicated he's moved support to his forum. There's a link around here somewhere. I'll be glad to look at the debug for you. I just use mdt to build a base image with everything applied. if that's not an option for you, like i mention earlier let me know. It;'s probably the path statement to the deployment tools if i had to guess. Did you add lines for windows 8 updates?
Apr 3, 2013 at 12:42 PM

Nope, not trying to inject updates for windows 8 at this time. Just running it from my Windows 8 workstation.

Apr 3, 2013 at 12:44 PM
So you are just trying to build a repository? Or just view the script in an ISE?
Apr 3, 2013 at 12:46 PM

Execute the script, so building the repo and injecting them into my wim’s.

Apr 3, 2013 at 12:48 PM
Edited Apr 3, 2013 at 12:49 PM
let me take a look, if you've made changes on your own please post them here
Apr 3, 2013 at 1:13 PM

I kept an un-modified copy. ;)

Biggest diff seems to be where the dism and imagex executable are stored. On my x64 workstation, they are both in (C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\amd64\DISM) for the x64 versions and (C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\x86\DISM) for the x86 versions.

I was thinking about hard-coding the path and seeing how much further I got.

Apr 3, 2013 at 1:15 PM
that's what you'll need to do
Apr 3, 2013 at 3:15 PM
Edited Apr 4, 2013 at 12:33 PM
You cannot call a method on a null-valued expression.

At C:\scripts\imagepatcher_modified.ps1:173 char:10
  • $writer.Close()
  • ~~~~~~~~~~~~~~~
  • CategoryInfo : InvalidOperation: (:) [], RuntimeException
  • FullyQualifiedErrorId : InvokeMethodOnNull
ls : Cannot find path 'C:\scripts\http:' because it does not exist.

At C:\scripts\imagepatcher_modified.ps1:181 char:7
  • ls $fileName
  • ~~~~~~~~~~~~
  • CategoryInfo : ObjectNotFound: (C:\scripts\http::String) [Get-ChildItem], ItemNotFoundException
  • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
Missing wsusscn2.cab - probably download problem, check your internet connectivity



PS C:\Windows\system32>

I get the above while it is downloading the wsus file (shows the progress bar.) The file is not present after the progress bar finishes though.
Apr 3, 2013 at 6:34 PM
yea, i ran into that today too

in the get-webfile function change
$webfilename = $url.split("/")[$url.count-1]

to

$webfilename = $url.split("/")[$url.count+5]
Apr 3, 2013 at 8:52 PM
the first three lines to change would be :

[string]$dismpath = "$ENV:PROGRAMFILES\Windows AIK\Tools\$env:PROCESSOR_ARCHITECTURE\Servicing\dism.exe"
[string]$imagexpath = "$ENV:PROGRAMFILES\Windows AIK\Tools\$env:PROCESSOR_ARCHITECTURE\imagex.exe"
[string]$expandpath = "$ENV:PROGRAMFILES\Windows AIK\Tools\$env:PROCESSOR_ARCHITECTURE\Servicing\expand.exe"

they would need to point to the correct path to the files in the adk path
Apr 4, 2013 at 10:26 AM
[string]$dismpath = "C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\dism.exe"
[string]$imagexpath = "C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\imagex.exe"
[string]$expandpath = "C:\windows\system32\expand.exe"
Apr 4, 2013 at 11:14 AM
Edited Apr 4, 2013 at 11:35 AM
Ok with the above changes, I was able to get all the downloads to finish (it looks like anyways)

I now get the below error on my first wim.
C:\scripts\imagepatcher_modified.ps1 : --- Unable to process C:\scripts\wiminfo.xml probably caused by incorrect wim file ---
At C:\scripts\Monthly_inject_windows_updates.ps1:2 char:1
  • c:\scripts\imagepatcher_modified.ps1 -imagefile:'O:\Windows 7 Enterprise SP1 x86 ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,imagepatcher_modified.ps1
Looking at the wiminfo.xml file, the script cant see the files sitting on the mapped drive ;)
I'm copying them locally and will run it once that's finished.
Apr 4, 2013 at 12:33 PM
Something seems to be wrong with how its downloading the updates.

secu file already downloaded, will use the old one
secu file already downloaded, will use the old one
secu file already downloaded, will use the old one
secu file already downloaded, will use the old one
secu file already downloaded, will use the old one
uprl file already downloaded, will use the old one
secu file already downloaded, will use the old one
secu file already downloaded, will use the old one
uprl file already downloaded, will use the old one
secu file already downloaded, will use the old one
secu file already downloaded, will use the old one
secu file already downloaded, will use the old one

I recall the last time I ran this, it listed the actual patches themselves.
Apr 17, 2013 at 6:00 PM
I have an updated script that when used on windows 2012 / windows 8 does not require adk. But i currently only have it working for vhd and vhdx files.

I will try to get wim's working in the next few days if people are interested.

Davey
Apr 17, 2013 at 6:01 PM

That would be awesome. J

Jun 10, 2013 at 6:17 PM
I copied the ADK from Program Files (x86) to the standard Program Files directory and edited the lines
[string]$dismpath = "$ENV:PROGRAMFILES\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\$env:PROCESSOR_ARCHITECTURE\DISM\dism.exe"
[string]$imagexpath = "$ENV:PROGRAMFILES\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\$env:PROCESSOR_ARCHITECTURE\DISM\imagex.exe"
[string]$expandpath = "$ENV:PROGRAMFILES\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\$env:PROCESSOR_ARCHITECTURE\DISM\expand.exe"

image updated as expected after the change.

Hope it works for you too!

Of course I wouldn't mind the option DaveyRance has of not requiring ADK :)

DJ
Nov 18, 2013 at 6:06 PM

Hi DtJones

Sorry this seemed to have skipped in my email.

Rename to .ps1 and you should be good to go.

Davey