Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

[OT] Ensure-DSC for WindowsFeatures broken



  • Hi,

    I'm moving slowly from Otter 3.0.24 to otter 2023.3 (docker).

    I am using Ensure-DSC functiuon to deploy WindowsFeatures like this:

    For a specific role:

    • set up a variable :
    @ListofWFeatures : @(RSAT-AD-PowerShell, RSAT-DNS-Server)
    

    Desired configuration

    # WindowsFeatures
    {
        foreach $WindowsFeature in @ListofWFeatures
        {
            Log-Information ===== $WindowsFeature;
                Ensure-DscResource
                (
                    Name: WindowsFeature,
                    Properties: %(Name:$WindowsFeature,IncludeAllSubFeature:true)
                );
        }
    }
    

    On version 3.X, this is working fine (target w2022 / inedo agent 49)
    On version 2023, it is broken (target windows 2022 with Inedo agent 51)

    Error Unhandled exception: System.Management.Automation.Remoting.PSRemotingTransportException: Serialized XML is nested too deeply. Line 1, position 3508.
       at System.Management.Automation.Runspaces.AsyncResult.EndInvoke()
       at System.Management.Automation.PowerShell.EndInvoke(IAsyncResult asyncResult)
       at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
    ....
    

    Any help is welcome.

    Best regards
    PhilippeC.



  • I got around with a PSEnsure (v2) powershell script.


  • inedo-engineer

    Hi @philippe-camelio_3885,

    This is the result of a long-standing WONTFIX bug within PowerShell Remoting. Considering that DSC is effectively dead, we don't see any point in try to work-around the bug. You can see more details/discussion here (Otter role issue after upgrading to 22.0.2).

    In general, we advise all users to move away from PowerShell DSC. It was basically killed by Microsoft, and its corpse was resurrected to be used in Azure Automanage. From the docs:

    DSC 2.0 is supported for use with Azure Automanage's machine configuration feature. Other scenarios, such as directly calling DSC Resources with Invoke-DscResource, may be functional but aren't the primary intended use of this version.

    Since last year, there was a quasi-community effort started to bring back DSC as "DSC 3.0", but it's in early alpha and has no official support. Given the pace of similar PowerShell developments (like the v3 of PowerShell Gallery), I would expect 3-5 years for a somewhat stable version.

    Best,
    Alana



  • Hi @atripp

    Thanks for the update. Microsoft is killing me 🙄
    Best Regards

    PhilippeC.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation