package resource not applying

This topic contains 1 reply, has 2 voices, and was last updated by  Don Jones 2 years, 3 months ago.

  • Author
    Posts
  • #26813

    jdbrouwer
    Participant

    I'm currently having an issue with a package resource not applying to a server in my DSC config.

    Config can be found below:


    Configuration DSCIISInstallation
    {

    param ($MachineName)

    Node $MachineName
    {

    {Package 'Webdeploy Tool'
    {Name = 'Webdeploy Tool'
    Path = 'C:\tmp\\Webdeploy\WebDeploy_2_10_amd64_en-US.msi'
    ProductId = '88453A48-740B-4F33-8BF0-E15489874D4C'
    Ensure = "Present"
    Arguments = "ADDLOCAL=MSDeployFeature,MSDeployAgentFeature"
    LogPath = 'C:\tmp\log.txt'
    }
    }
    }
    #Install the IIS Role
    foreach ($Feature in $WebserverConfig )
    {WindowsFeature "$Feature$Number"
    {
    Ensure = 'Present'
    Name = $Feature
    }
    }
    {WindowsFeature 'Web-Net-Ext'
    {
    Ensure = 'Present'
    Name = Web-Net-Ext
    Source = '\\Server\Microsoft\WindowsSrv2012R2\Sources\sxs'
    }
    }

    {WindowsFeature 'Web-ASP-Ext'
    {
    Ensure = 'Present'
    Name = Web-ASP-Ext
    Source = '\\Server\Microsoft\WindowsSrv2012R2\Sources\sxs'
    }
    }

    {WindowsFeature 'Net-Framework-core'
    {
    Ensure = 'Present'
    Name = Net-Framework-core
    Source = '\\Server\Microsoft\WindowsSrv2012R2\Sources\sxs'
    }
    }

    {WindowsFeature 'Net-Framework-Features'
    {
    Ensure = 'Present'
    Name = Net-Framework-Features
    Source = '\\Server\Microsoft\WindowsSrv2012R2\Sources\sxs'
    }
    }

    }

    $WebserverConfig = @('Web-Server','Web-WebServer','Web-Common-Http','Web-Default-Doc','Web-Dir-Browsing',
    'Web-Http-Errors','Web-Static-Content','Web-Http-Redirect','Web-Health','Web-Http-Logging','Web-Performance',
    'Web-Stat-Compression','Web-Security','Web-Filtering','Web-Windows-Auth','Web-App-Dev',
    'Web-Net-Ext45','Web-ASP','Web-Asp-Net45','Web-ISAPI-Ext','Web-ISAPI-Filter','Web-Mgmt-Tools',
    'Web-Mgmt-Console','NET-Framework-45-Features','NET-Framework-45-Core',
    'NET-Framework-45-ASPNET','NET-WCF-Services45','NET-WCF-TCP-PortSharing45','Web-Mgmt-Service')

    The entire array of web stuff install fine. The package i want to deploy does not, I sadly do not have anymore information as it seems that DSC is not outputting anything in regards to this package.

    Does it has something to do with the foreach loop? Also, as a bit of a side question, does it actually matter if i use single or double-quotes in DSC? i know in normal Powershell, the single quote is interpreted as flat text, so I was wondering if this has any effect in the DSC configurations?

  • #26921

    Don Jones
    Keymaster

    Have you enabled diagnostics (PSDiagnostics module) and examined the DSC debug log? Without any diagnostic information, there's absolutely no way to help you, sorry.

    PowerShell treats double and single quotes more or less the same. In double quotes, you can use variables and subexpressions and have them evaluated at the time the string is created.

You must be logged in to reply to this topic.