Beware Windows 10 Technical Preview

This topic contains 5 replies, has 4 voices, and was last updated by Profile photo of Rob Cannon Rob Cannon 2 years, 2 months ago.

  • Author
    Posts
  • #19330
    Profile photo of Rob Cannon
    Rob Cannon
    Participant

    I tried out Windows 10 Technical Preview on one of my computers. As expected, I got an updated version of PowerShell (5.0.9841.0, to be exact).

    But, it seems to break pushing a DSC resource to another server. When I do so, I get this error message:

    VERBOSE: [SSCDEVPLAY02]: LCM: [ End Set ]
    Undefined property ConfigurationName
    At line:17, char:2
    Buffer:
    rverConfiguration";
    };^
    insta
    + CategoryInfo : SyntaxError: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MiClientApiError_Failed
    + PSComputerName : SSCDEVPLAY02

    It's a good thing I have more than one computer...

  • #19331
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    Yep, that's a known issue right now with the WMF 5.0 preview (not limited to Windows 10). Microsoft is aware of it, but I'm not sure how they're going to resolve the problem yet.

    As long as you compile your MOF files from a WMF 4.0 computer, you should be fine. To my knowledge, there's no problem pushing those MOFs from a WMF 5.0 system; it's just the contents of the MOF that have changed (and are currently not backwards-compatible.)

  • #19332
    Profile photo of Richard Siddaway
    Richard Siddaway
    Moderator

    Its actually an issue with DSC in WMF 5 which is installed in Windows 10. Two extra lines are added to the MOF file eg

    instance of MSFT_FileDirectoryConfiguration as $MSFT_FileDirectoryConfiguration1ref
    {
     ConfigurationName = "WinConfig1";
    };
    instance of OMI_ConfigurationDocument
    {  
    Version="1.0.0";  
    Author="Richard";  
    GenerationDate="09/20/2014 19:03:06";  
    GenerationHost="W12R2DSC";  
    Name="WinConfig1";
    };

    The extra lines are the Name= and Configuration= lines above.

    If your target is running WMF 4 (PowerShell 4) DSC will throw an error when you try to apply the configuration. Simply remove the 2 lines and you're good to go

    This is known by Microsoft as the September preview of WMF 5 is the same PowerShell build as Windows 10 preview and they are working on fixing the issue.

    If you push to a server running WMF 5 September preview you won't see the problem

  • #19341
    Profile photo of Palmar
    Palmar
    Participant

    I think it actually adds the ConfigurationName property to every instance of a resource you create. So in a large configuration it'd be painful to manually remove.

  • #19344
    Profile photo of Richard Siddaway
    Richard Siddaway
    Moderator

    Brute force removal like this:

    Get-ChildItem -Path $path |
    foreach {
     $mof = Get-Content -Path  $psitem.FullName | 
     where {($_ -notlike ' Name=*') -AND ($_ -notlike ' ConfigurationName*')}
     Set-Content -Value $mof -Path $psitem.FullName -Force
    }
    
  • #19416
    Profile photo of Rob Cannon
    Rob Cannon
    Participant

    Thank for the suggestions.

    I like cleaning up the .mof files because it will continue to be an issue when we start transitioning to WMF 5 (unless they patch WMF 4 to accept the newer files).

You must be logged in to reply to this topic.