The resource you are depending on, "[PackageManagementSource]PSGallery", where is that coming from, is that from another configuration that should already have been applied? For my eyes it seems that you are depending on a piece of configuration that is not there....
Unable to install packages with DSC configuration- Server 2019
Hi Team,
I am trying to install packages using PackageManagement (DSC resource). The below mentioned script works fine in Server 2016 and installs required packages. But in Windows server 2019 I am getting errors like ValidateNodeResources : Resource '[PackageManagementSource]PSGallery' required by
'[PackageManagement]xWebAdministration' does not exist. Please ensure that the required resource exists and the name
is properly formed
Not sure if there is anything blocking on 2019 server which is allowed in 2016 server. Kindly advise.
Script:
Configuration mypackages
{
Import-DscResource -Name PackageManagementSource
Import-DSCResource -Name PackageManagement
node localhost
{
PackageManagement xWebAdministration
{
Ensure = "Present"
Name = "xWebAdministration"
Source = "PSGallery"
DependsOn = "[PackageManagementSource]PSGallery"
}
PackageManagement xPSDesiredStateConfiguration
{
Ensure = "Present"
Name = "xPSDesiredStateConfiguration"
Source = "PSGallery"
DependsOn = "[PackageManagementSource]PSGallery"
}
}
}
$config = mypackages -Verbose
Start-DscConfiguration -Wait -Verbose -force -Path $config.PsParentPath