Author Posts

March 21, 2016 at 10:30 pm

I am doing what the warning suggests, but I still get the warning.

Any idea how I can get this to stop?

I did add the xPSDesiredStateConfiguration instead of the PSDesiredStateConfiguration, I thought I would want the newest code to work with the configuration, but it seems I am missing something.

PS C:\> Configuration SimpleDSC
{
        param ( $NodeName )
        Import-DscResource –ModuleName 'xPSDesiredStateConfiguration'
        Node $NodeName
        {
            WindowsFeature WebBackup
                {
                    Ensure = "Present"
                    Name = "Windows-Server-Backup"
		}
	}
}

$nDir = mkdir C:\DSC\SimpleConfig\$Computer -Force

SimpleDSC -OutputPath $nDir.FullName -NodeName $Computer -Verbose
WARNING: The configuration 'SimpleDSC' is loading one or more built-in resources without explicitly importing associated modules. Add Import-DscResource –ModuleName
 'PSDesiredStateConfiguration' to your configuration to avoid this message.


    Directory: C:\DSC\SimpleConfig\cho3w9wb24


Mode                LastWriteTime         Length Name                                                                                                              
----                -------------         ------ ----                                                                                                              
-a----        3/22/2016   2:23 AM           1898 cho3w9wb24.mof < \pre>

March 22, 2016 at 12:25 am

Usualy this means there's something wrong with your $env:PSMosulePath.

Nothing in your script requires xPSDesiredStateConfiguration, so no need to add it.

March 22, 2016 at 3:59 am

The warning says you should import PSDesiredStateConfiguration, not xPSDesiredStateConfiguration. đŸ™‚ No "x".