Uploaded image for project: 'Puppet Task Runner'
  1. Puppet Task Runner
  2. BOLT-72

Don't invoke new powershell instances

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: BOLT 0.9.0
    • Component/s: Windows
    • Labels:
    • Template:
    • Sprint:
      Bolt Kanban
    • Release Notes:
      New Feature
    • Release Notes Summary:
      Hide
      This improves performance of the WinRM transport by running PowerShell-based Bolt scripts and tasks in the connected WinRM session, rather than creating new PowerShell processes. This also fixes an issue with properly reflecting failure status on PowerShell versions older than PowerShell 5. Users should not rely on variables set between commands persisting, even those set in the $global scope. Users should not rely on [Console]::WriteLine to produce output from PowerShell code.
      Show
      This improves performance of the WinRM transport by running PowerShell-based Bolt scripts and tasks in the connected WinRM session, rather than creating new PowerShell processes. This also fixes an issue with properly reflecting failure status on PowerShell versions older than PowerShell 5. Users should not rely on variables set between commands persisting, even those set in the $global scope. Users should not rely on [Console]::WriteLine to produce output from PowerShell code.
    • QA Risk Assessment:
      Needs Assessment

      Description

      When executing a script or task, we copy the file to the remote system over winrm, and then invoke powershell.exe on the file. Invoking powershell is slow, and we could instead eval the script contents in our current powershell instance.

      However, to do that we need to make sure we clear any state from a previously executed command or script, which includes clearing PT_ environment variables. Longer term we probably need to implement runspaces like we do for the powershell module. But for this ticket, I think it's ok to just clear environment variables and no longer invoke another powershell instance.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  josh Josh Cooper
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: