gaelcolas / DscInfraSample

A Control Repo for a DSC Infrastructure as Code
MIT License
47 stars 22 forks source link

Datum error after Cumulative Update June #18

Closed raandree closed 6 years ago

raandree commented 6 years ago

Originally created by @outek in Datum as gaelcolas/Datum#52. As this is not a Datum but more DSC issue, I am duplicating the issue here. See for details.

I've noticed an error after the CU June for my 2016 Server, and i took me some time to find out, what possibly cause this error. After the (update)reboot i was not longer able to build the mof files. The error message was this one:

===============================================================================
            COMPILE ROOT CONFIGURATION

-------------------------------------------------------------------------------
  /./Compile_Root_Configuration
  C:\Temp\DSC\.build\DSC\ConfigData.build.ps1:63

-----------------------
FilteredNode: 
-----------------------
PSDesiredStateConfiguration\Configuration : The term 'Set-PSTopConfigurationName' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a 
path was included, verify that the path is correct and try again.
At C:\Temp\DSC\RootConfiguration.ps1:7 char:1
+ configuration "RootConfiguration"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Set-PSTopConfigurationName:String) [Configuration], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : CommandNotFoundException,Configuration

ERROR OCCURED DURING COMPILATION
Done /./Compile_Root_Configuration 00:00:15.2377078

As mentioned before, this happened only on a fresh patched buildserver.

PS C:\Temp\DSC> $PSVersionTable
Name                           Value                                                                                                                                                                 
----                           -----
PSVersion                      5.1.14393.2312                                                                                                                                                  
PSEdition                      Desktop                                                                                                                                                            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                               
BuildVersion                   10.0.14393.2312                                                                                                                                                
CLRVersion                     4.0.30319.42000                                                                                                                                                
WSManStackVersion              3.0                                                                                                                                                                     
PSRemotingProtocolVersion      2.3                                                                                                                                                                     
SerializationVersion           1.1.0.1 

I copied the Module PSDesiredStateConfiguration from an unpatched prod server to this server with the error to "C:\Windows\System32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration" and replaced this module. The feshly started build of the mof files went through as usual.

gaelcolas commented 6 years ago

This has been fixed by @SimonWahlin in #20

Let me know if any issue.