Hyper-V on Windows 10, how to fix a broken VHD

I’m running Windows 10 w/ Hyper-V on my home lab pc, and found a strange Hyper-V error this week.

One of the core things you shouldn’t do with differencing disks is to ever, ever move or edit the parent disk, or else you can break the child disk.  I added some more storage and moved my VHDs around to an all SSD Raid, then found that I’d broken the chain of VHDs for one of my VMs.

When trying to start the VM, this is the error you’ll see.

Img 1
The chain of virtual hard disks is broken. The system cannot locate the parent virtual hard disk for the differencing disk.

Normally, one runs ‘Inspect Disk’ from Hyper-V to locate the parent disk of a child VHD, which will fix the chain of differencing and allow your VMs to access the disks again.  However on Windows 10, clicking ‘Inspect Disk’ will result in Hyper-V throwing a fatal error.

There was a problem with one of the command line parameters. Either 'BEHEMOTH' could not be found, or 'X:\Virtual Machines\Virtual Hard Disks\VM01.vhdx' is not a valid path. Property 'MaxInternalSize' does not exist in class 'Msvm_VirtualHardDiskSettingData'.
There was a problem with one of the command line parameters. Either ‘BEHEMOTH’ could not be found, or ‘X:\Virtual Machines\Virtual Hard Disks\VM01.vhdx’ is not a valid path.
Property ‘MaxInternalSize’ does not exist in class ‘Msvm_VirtualHardDiskSettingData’.

The path is valid and exists. I’ve found a workaround, that of using PowerShell and the Hyper-V module to run Set-VHD, like so:

set-vhd -Path ‘X:\Virtual Machines\Virtual Hard Disks\VM01.vhdx’ `
-ParentPath “X:\Server2012Template\Virtual Hard Disks\Server2012Template.vhdx”

Anyway, this is a bit of a bugger, and I’ve alerted authorities in Redmond, so we should see a fix soon :)

Using PowerShell and oAuth

the oAuth Flow

Like most of my posts here, I’m going to try to make something sound easy, when in reality I’ve spent months crying into my coffee trying to understand it. In truth, I’ve been trying to get oAuth to work for more than a year now.

It all started with a simple goal, I just wanted to check my blog stats easily using WordPress’s REST API, and I wanted to do it from PowerShell, should be simple, right? WRONG

My initial issue was that I didn’t want to understand oAuth, I just wanted to copy and paste some stuff and hope that it worked. I can tell you now that I’ve worked it out, it really isn’t that difficult, but knowing what’s happening will make it all much easier.

What is oAuth?

oAuth was made to solve a problem, that of sharing information between two different web services. For this reason, 99% of the examples and walk throughs that you’ll find online will be written in php, or use cUrl commands (an awesome *Nix command line utility), which is all well and good if you’re writing a server application, but not too useful to script things using a language like PowerShell. That being said, it is still possible, it just takes being a bit clever to get it to work.

We need oAuth because a user may want to right click a file from Dropbox.com and post it on Facebook with one click, for instance. Or have their Twitter send a Tweet when they update their Blog on WordPress. Either way, oAuth is a crucial verification step when tying two services together, and it’s worth the time to spend learning how it works. Furthermore, most of the coolest REST APIs out there require you to authenticate using oAuth in order to even use them.  Now, let’s see what the steps are to get your application (or script) linked to a service that uses oAuth.
Continue reading

Part IV – PowerShell GUIs – how to handle events and create a Tabbed Interface


This post is part of the Learning GUI Toolmaking Series, here on FoxDeploy. Click the banner to return to the series jump page!

Where we left off

Previously in Part III of our GUI series, we left off with a review of some advanced GUI options, things like radio buttons, text replacement and things like that. In this section, we’ll grow our tool from Part I, our lowly Ping tool, and expand it to become a fully-fledged remote PC management tool. We’ll do this to learn our way through some new GUI concepts we haven’t run into before. I’ll take you through making most of this tool, and leave you at a place where you should be able to take it the rest of the way.

What we’ll cover

If you walk through this guide, I guarantee that we’ll cover each of these items below. If there is something you’d like to see covered in a future post, send me an e-mail! Each of the items covered in this post came from requests from my readers.


I am gathering input for post five right now, so let me know what’d you’d like to do with PowerShell, and we can make it happen.

Making a Tabbed Interface

We’re going to talk about the right way to use this element, to make it obvious to users (something called ‘Discoverability’) that more tools and options exist, if they’d only click this tab and explore around a bit! In tab one, we’ll drop in the whole of our pinging tool from Part I of this walkthrough, while we’ll hide extra functionality in tabs two, three and four. For extra niftiness, we’ll have the others tabs be disabled (unclickable) until the user first verifies that a PC is online in tab one.

Handling UI Events

This is the part that has me the most excited, mostly because I just learned about how to do it, and it solves so many issues. Want to have your GUI run a chunk of code when the user edits a textBox. Or handle the event which is triggered if the user moves the mouse over a button? We can even wait till the user is finished entering text, and then run a short chunk of code to validate an entry. These are all real world scenarios for a User Interface Developer, and we can easily deal with them in PowerShell.

Let’s get started.

Tabs, not just for playing ‘The house of the rising sun’

Continue reading

New in Windows 10: Changing home to Pro w/ no reinstall!

One of the hotly anticipated features of Windows 10 is the ability to change your Windows version on the fly, without even needing to reinstall the OS!

This means that if you’re a Home user and want to start using advanced features like Hyper-V, which is only available on Pro, or to begin using your computer with BranchCache and other technologies only found on Enterprise, you don’t need to reinstall anymore.


You decide one day that Hyper-V sounds awesome and you want to be able to run Virtual Machines on your laptop/desktop. You go to ‘Turn Windows Features on or off’ and Continue reading