Author Posts

February 15, 2016 at 6:23 am

I am trying to take the MVC Getting Started with Powershell Desired State Configuration series, and feel like a fool. I am trying to follow Jason Helmick's simple push script to ensure that IIS is present, and encountering errors and configuration issues at every turn.

I have been through the Getting Started and Advanced Tools and Scripting Jumpstart courses, and am still having difficulty with setup. When I try and run the sample script, I get the warning "WARNING: The configuration 'ConfigName' is loading one or more built-in resources without explicitly importing associated modules. Add Import-DscR
esource –ModuleName 'PSDesiredStateConfiguration' to your configuration to avoid this message." However, "Import-DscResource" is not an available command on my Powershell.

My $PSVersionTable information is as follows:
PSVersion 5.0.10586.63
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.10586.63
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

and Get-Module shows I have DSC 1.1 installed.

I have managed to install Chocolatey, and am trying to remote to a W2K12 test server hosted on VMWare Workstation 12.

Is there a basic guide or page somewhere that I can check to make sure I have installed the correct versions of WMF and am configured properly to correctly execute the course?

Learning by error is one thing, but I'm thrashing around here and not being effective at all.

February 15, 2016 at 1:41 pm

Hi Kerry,
Keep going in the series, they will get to that part about "Add Import-DscResource –ModuleName 'PSDesiredStateConfiguration' to your configuration "..

It isn't really a Resource in the way we all think, but they will explain why.

To fix the error, put "Import-DscResource –ModuleName 'PSDesiredStateConfiguration'" in your configuration:

`configuration $configName {
Import-DscResource –ModuleName 'PSDesiredStateConfiguration'

Node $nodename {
....
}
}`

Just finnished the series my self, it's great!

February 15, 2016 at 2:57 pm

Hi Kerry!

Technically its not an error — just a warning and your config should still work. It was a message added in a later version of the WMF after we were shooting. As Richard pointed out, you can fix it — and we show that later in the series. The series was shot using the February WMF 5, however everything still works on the current Preview release.

How else can I help?

Jason

February 17, 2016 at 4:35 am

Thank you both for the replies. Adding "Import-DscResource" to the script did indeed take care of the problem, along with correcting a minor bug of my own. (the script was originally generating the MOF file in my Powershell home instead of the specified OutputPath, so the warning combined with not seeing the MOF in the expected location threw me). Of course, when that path has spaces, you must put it in quotes.

More general comment: I get an hour or two every couple of days to work on this, and have been bound up for the past couple of weeks trying to configure my VM so I could push to it. I didn't see any sense in pushing through the course without an environment that I can play along in and duplicate the work. I finally found some guidance by Sean Kearney in his post Doing a PowerShell DSC PUSH (Desired State Configuration) to Non Trusted or Non Domain Joined computer".

I guess the point is I'm spending a lot of time researching setup & configuration (and finding out that the WMF 5 RTM is delayed and wasn't helpful), and not as much time writing scripts. In the end, it is all good as I'm learning and taking notes and will be a better developer for it.

@jasonhelmick – Overall you guys are doing a great job. These courses are informative and pretty easy to refer back to when I get stuck. Keep up the good work.