1

I've been experimenting with running Powershell DSC on Windows Server 2016 Nano (TP 5). When I run the configuration, I get the following error:

PowerShell DSC resource MSFT_xWindowsFeature failed to execute Test-TargetResource functionality with error message: Installing roles and features using PowerShell Desired State Configuration is supported only on Server SKU's. It is not supported on Client SKU.

Surely, Nano is a server SKU, right?

In case you're interested, here is the DSC configuration I'm using (although I did have to fix one issue, see https://github.com/PowerShell/xPSDesiredStateConfiguration/pull/258):

Configuration Webserver 
{
    Import-DscResource -ModuleName xPSDesiredStateConfiguration

    Node "172.28.128.9"
    {
        Log MyMessage
        {
            Message = "This installs IIS"
        }
        xWindowsFeature "Webserver"
        {
            Name = "Web-Server"
            Ensure = "Present"
            IncludeAllSubFeature = $TRUE
        }
    }
}
NickRamirez
  • 165
  • 8

1 Answers1

3

The Test-TargetResource function in MSFT_xWindowsFeature.psm1 tries to import the server manager PS module (not available in nano server) and throws that exception if it fails:

 try
{
    Import-Module -Name 'ServerManager' -ErrorAction Stop
}
catch [System.Management.Automation.RuntimeException] {
    if ($_.Exception.Message -like "*Some or all identity references could not be translated*")
    {
        Write-Verbose $_.Exception.Message
    }
    else
    {
        Write-Verbose -Message $script:localizedData.ServerManagerModuleNotFoundMessage
        New-InvalidOperationException -Message $script:localizedData.SkuNotSupported
    }
}
catch
{
    Write-Verbose -Message $script:localizedData.ServerManagerModuleNotFoundMessage
    New-InvalidOperationException -Message $script:localizedData.SkuNotSupported
}

The text for that error message is not necessarily accurate about the server being a client SKU and is defined in MSFT_xWindowsFeature.strings.psd1:

SkuNotSupported = Installing roles and features using PowerShell Desired State Configuration is supported only on Server SKU's. It is not supported on Client SKU.
AdBarnes
  • 31
  • 3