Convert-WindowsImage.ps1 Alternative #16
Replies: 6 comments
-
|
Nice work, @jontywigster!
As a result, it is only compatible with Windows PowerShell 5.1 and does not support newer versions such as PowerShell Core (6.0). Additionally, the script was initially designed with a graphical user interface, adding to its complexity. That said, its core functionality remains similar to your script: it generates a VHDx with the necessary partitions and applies an image using DISM. I never prioritized porting it to PowerShell Core because (until now) all my use cases allowed me to simply use Keep up the great work! P.S.: As a suggestion, maybe you could create a gist? It would be a more convenient way to track and manage the evolving code. |
Beta Was this translation helpful? Give feedback.
-
|
Hello! A GUI! I started skipping over large chunks I thought weren't relevant (to me) so never thought of this. Thanks.
It just seemed like the hot new thing, and I understood 5.1 wasn't getting new features. And I'm too lazy to create a new profile in VS Code...
https://gist.github.com/jontywigster/a12d40457d4886631925fa5182a43868 Thanks again! |
Beta Was this translation helpful? Give feedback.
-
Correct. However, it is still supported. And given that Windows Server 2025 includes it, you can reasonably expect support to continue for at least another ten years. https://learn.microsoft.com/en-us/powershell/scripting/install/powershell-support-lifecycle I still have A LOT of build an deploy scripts in Windows Powershell (5.1).
But not quite lazy enough to port the entire functionality of a battle-tested script to another platform! 😄👍🏻 |
Beta Was this translation helpful? Give feedback.
-
|
just chipping in my two cents, I was looking at this as well. For me, I had a very large number of VMs to script up and I noticed how much time this spent "Converting ISOs to VHDx" files, so I started to implement a caching mechanism.. to only create the vhdx once, and to store it in a "cache" folder. Then subsequent calls could be a copy operation rather than a convert operation.. |
Beta Was this translation helpful? Give feedback.
-
|
Hi,
I didn't realise 5.1's going to be supported for so long. Nice! My stuff is only for me so I'm not worried about battle-hardening. I've disturbed you much more than I intended, thanks again. Should I close this issue? I see JamesMilne has commented about caching so perhaps it should stay open. Anyway, cheers! |
Beta Was this translation helpful? Give feedback.
-
|
No problem, @jontywigster. Issues actually are a great way to track problems effectively. So, I have enabled GitHub Discussions and migrated your thread there. We can continue the talk here. First post! 😄🚀 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've no idea if this of interest at all, or whether it was already discussed. Apologies!
I built a small set of scripts to build Linux and Windows Hyper-V VMs too, but only in a way suitable for my environment. I originally built Windows VMs from WDS but this takes ages so I hunted for ways to speed up the install, and found this fantastic repo. Congrats!
I was curious about Convert-WindowsImage.ps1 but it seems to have some strict requirements about the PowerShell environment it can run in. I fiddle in VS Code and couldn't figure out how to use it but I don't really know what I'm doing in PoSh.
I took at look at what Convert-WindowsImage.ps1 does, couldn't figure out various bits, but came up with some terrible hackery -
My only goal was to be able to create a VHDX from an ISO, in VS Code. Obviously, my bodging doesn't do everything Convert-WindowsImage.ps1 does but I can't even figure out what most of that large script does. I really don't know what I'm doing in PoSh so might have done this for nothing.
Again, I have no idea if useful in any way. It's just a start of some ideas, has terrible error handling and other bits so far, and is not meant with any disrespect to the convert script, or this repo.
Cheers.
Beta Was this translation helpful? Give feedback.
All reactions