Windows upgrade options via script

So you want to upgrade your OS.  You have no idea if the particular one that came shipped with your PC allows it or not.  All the articles online say it can work but how can you tell?  Easy peasy lemon squeeze!

Open an elevated command prompt and type:

dism /online /get-targeteditions

Now, just to be clear, there are two “gotchas” here

First, if you do not have the /online switch the command will fail. DISM needs to know what .wim file to look at.  The /online options tells it to use the one currently in use and not a different one.  If you want to point to an offline image just the /image: <path to file> command instead

Second, there is an “s” at the end. The flip side of this coin is finding out what the current version is and that command has no “s” at the end: dism /online /get-currentedition.  So if you live by copy/paste or command history (like this guy) that little character is needed to make the command valid – took me a few frantic minutes to realize why my carefully written command was suddenly not working!

Keep your stick on the ice!