package resource not applying

Welcome Forums DSC (Desired State Configuration) package resource not applying

Viewing 1 reply thread
  • Author
    Posts
    • #26813
      Participant
      Topics: 1
      Replies: 0
      Points: 0
      Rank: Member

      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
      Keymaster
      Topics: 18
      Replies: 4872
      Points: 1,903
      Helping HandTeam Member
      Rank: Community Hero

      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.

Viewing 1 reply thread
  • The topic ‘package resource not applying’ is closed to new replies.