How Do I Install IIS With Puppet Logging The Process Start to Finish?

Welcome Forums General PowerShell Q&A How Do I Install IIS With Puppet Logging The Process Start to Finish?

This topic contains 2 replies, has 3 voices, and was last updated by

 
Participant
1 year, 11 months ago.

  • Author
    Posts
  • #59442

    Participant
    Points: 0
    Rank: Member

    Goal: To use Puppet to install IIS with full-duration logging.

    Problem: Through a simple PowerShell command, I install IIS but with poor Puppet logging. I need to get around this. For background, a Puppet manifest can execute this raw PowerShell command and successfully install IIS: Import-module servermanager; Add-windowsfeature web-server, web-webserver

    The Puppet technology can log and on the client (Puppet agent node) and server (Puppet Master server). But with the command above, Puppet logging does not stay with it. Normally to get around long-duration PowerShell processes, I use the "start-process" command with the "wait" option. This way the PowerShell operation does not return control until the targeted process is complete. Despite working well, I have found that this does not work for installing IIS. The error I get is consistent with not having sufficient permissions. Installing other things or doing other duties that require administrator privileges are normally not a problem with start-process. I try to get around this limitation of start-process and installing IIS by having a Scheduled Task kick off the installation of IIS. This Scheduled Task is executed by the "System" user. The IIS installation still fails.

    What can I do to install IIS and have a Puppet Manifest log the long-duration process? It seems that only a raw command will allow IIS to be installed. I want full-duration logging, and nothing I try works.

  • #59443

    Keymaster
    Points: 1,638
    Helping HandTeam Member
    Rank: Community Hero

    With respect, this seems more like a Puppet problem than a PowerShell one? The IIS installation kind of is what it is; it's not like you can really modify it.

  • #59500

    Participant
    Points: 160
    Helping Hand
    Rank: Participant

    To get verbose logging, you can also try the switch as well:

    Import-module servermanager
    Add-WindowsFeature web-server, web-webserver -Verbose
    

    Without any verbose logging enabled or even a try\catch around your Add-WindowsFeature, you're basically doing a silent installation. With a try catch, you can dig further into the exception and see if there anything to understand what is causing your failures.

The topic ‘How Do I Install IIS With Puppet Logging The Process Start to Finish?’ is closed to new replies.