Declaring a CompatibilityReport variable using Powershell RRS feed

  • Question

  • I am trying to get a script to run that  includes a function that returns a variable of type CompatibilityReport. In an attempt to debug this I am trying in a seperate script to run a simplified version. 

    I begin with using module Hyper-V and using name space Microsoft.HyperV.PowerShell.

    After this I set a variable equal to Compare-VM -Path ...

    This correctly returns a VMCompatibilityReport. However when I try to do something along the lines of :

    [VMCompatibilityReport]$check = $temp (where temp is the report I already made) it says it cannot find type VMCompatibilityReport.

    This also occurs if I use [Microsoft.HyperV.PowerShell.CompatibilityReport]$check = $temp.

    I spent quite a bit of time trying to add namespaces and types to get this to work and I was able to. However I had done so much testing in the same file I couldnt figure out what was the fix, and have proceeded to get stuck on this for hours again.

    Any help on what I need to add or use to be able to create CompatibilityReport variables would be a massive help.


    Thursday, July 5, 2018 10:58 PM