DSC Resource Does not Exist


I am trying to use the xHyper-v resource to run a simple configuraiton.

I keep getting this error when running Start-DscConfiguration “The PowerShell DSC resource MSFT_xVMSwitch does not exist at the PowerShell
module path nor is it registered as a WMI DSC resource.” When creating the MOF there is no error!!

However when I run get-module -listavailable it’s present. And when i run get-dscresoucre the xVMSwitch show thats its there as well

Heres the Config

Configuration MrHyperV_VM {
    param (
    Import-DscResource -module xHyper-V
    xVMSwitch switch {
        Name = $VMSwitchName
        Ensure = 'Present'
        Type = 'Internal'
    xVHD DiffVHD {
        Ensure = 'Present'
        Name = $VMName
        Path = $baseVhdPath
        ParentPath = $ParentPath
        Generation = 'vhdx'
    xVMHyperV CreateVM {
        Name = $VMName
        SwitchName = $VMSwitchName
        VhdPath = Join-Path -Path $baseVhdPath -ChildPath "$VMName.vhdx"
        ProcessorCount = 1
        MaximumMemory = 2GB
        MinimumMemory = 512MB
        RestartIfNeeded = 'True'
        DependsOn = '[xVHD]DiffVHD', '[xVMSwitch]switch'
        State = 'Running'
        Generation = 'vhdx'

MrHyperV_VM -VMName HCTest02 -baseVhdPath 'V:\VMs' -ParentPath "V:\VMs\VHDs\HCFil01.vhdx" -VMSwitchName 'ethernetSwitch'

Start-DscConfiguration -Wait -Path .\MrHyperV_VM -Verbose -Force

Im at a lost any help would be greatly appreciated

What folder is the xHyper-V module in right now? I seem to remember reading that in the original WMF 4.0 release, you had to place these modules in C:\Program Files\WindowsPowerShell\Modules\ in order for the LCM to work properly (as opposed to putting them in some custom folder on the PSModulePath.)

Are you getting this error at the MOF compliation step, or when you run Start-DscConfiguration?

The xHyper-v module is located in 2 places

C:\Program Files\WindowsPowerShell\Modules

and in $home\documents\windowspowershell\modules

It happens when i run Start-DscConfiguration , the MOF does get created

I am running PSverison 5 preview

I tried a v4 machine and it worked so must have something to do with the v5 Preview

And the folder contents are the same in both locations? Personally, I’d just remove the one in $home\Documents and leave the one in Program Files. That might fix the problem.

Thanks Dave I did that and on v4 Machine and it worked. As far as getting more examples for using the xhyper-v resource any suggestions?

I tested both locations and you were right The location needed to be moved …thanks again