Search code examples
powershelldsc

Could not install module dependencies needed by the configuration (DSC)


I am trying out the new Desired state configuration stuff and trying to work with a new class resource. I have installed the pre-production preview of WMF 5.0 on all servers involved in the process.

I have a Http pull server setup where I have deployed my class resource to.

The target nodes are configured to get their resources from this server which they seem to be doing.

However when I try to push a configuration out to the target nodes that use this class resource I get the following error

Checksum for module DeploymentClass_1.0 doesn't match. Could not install module dependencies needed by the configuration.
+ CategoryInfo          : InvalidResult: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : WebDownloadManagerModuleMismatchChecksum,Microsoft.PowerShell.DesiredStateConfiguration.Commands.GetDscModuleCommand
+ PSComputerName        : DDsTest002

I am not sure what the dependencies are that it needs as pretty much the same code wrapped up in the old powershell way of creating a custom resource works fine. Any ideas on how to identify the missing dependencies? Once identified any ideas on how I would make these automatically available to an nodes that require the resources without going and installing a bunch of stuff on each target node that needs them?

Answer Edit - With thanks to Dan1el42

Here is the modified code to generate the checksum that fixed this for me. As Dan suggested just adding the -Force flag to New-DscChecksum command did the trick.

$modulePath='M:\Modules\DeploymentClass'
#get module Version
$content=Get-Content $modulePath\DeploymentClass.psd1
$version=$content[14].Split("'")[1]
$version

$archiveFQN = 'C:\Program Files\WindowsPowerShell\DscService\Modules\DeploymentClass_' + $version + '.zip'
$archiveFQN

Compress-Archive -Path $modulePath -DestinationPath $archiveFQN -Force

New-DscChecksum $archiveFQN -Force

Solution

  • Looks like the checksum file DeploymentClass_1.0.zip.checksum does not match your DeploymentClass_1.0.zip. Please run New-DscChecksum again with the -Force switch.