Powershell – Why can’t DSC find a resource that’s installed

dscpowershell

I'm trying to apply a DSC configuration that uses a resource from a module that is installed. However, when I run Start-DscConfiguration, I get this error:

The PowerShell DSC resource ******** does not exist at the PowerShell module path nor is it registered as a WMI DSC resource.
+ CategoryInfo : InvalidOperation: (root/Microsoft/…gurationManager:String) [], CimException
+ FullyQualifiedErrorId : DscResourceNotFound

However, when I log into the server and run Get-DscResource, the missing resource is there.

Why can't DSC find the resource?

Best Answer

The version of the module the DSC resources are part of was different between my local computer and the server. On my local computer, where my configuration gets converted to MOF files, I had version 2.2.0 (code snipped for brevity):

instance of ******** as $********1ref
{
 ModuleName = "********";
 ModuleVersion = "2.2.0";
};

But the server had version 2.1.0:

> Get-Module -ListAvailable

    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------       
Script     2.1.0      ********                            ********

This particular module is available on the PowerShell Gallery. Calling Update-Module got the latest version onto my server. I also could have downgraded my local computer.