Use the version of Hyper-V instead of Powershell to determine which exception is thrown by Get-VM. Also fixing an invalid catch statement, since Powershell can not use variables to match thrown exceptions in catch.