puppetlabs / puppetlabs/puppetlabs-powershell

pwsh - output not returned to puppet if Automatic Transcription is enabled

Open
#424 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
47
Forks
80
Avg merge
52m
Merged PRs (30d)
1

Description

Describe the Bug

on windows nodes, when Automatic transcription is switched on for Powershell Core (HKLM\SOFTWARE\Policies\Microsoft\PowerShellCore\Transcription\EnableTranscripting), puppet no longer gets the output from an exec using the pwsh provider

Expected Behavior

when puppet executes an Exec resource using the pwsh provider and with logoutput => true, any output produced by the powershell commands should be returned to puppet and displayed either in the console or in event viewer.

Steps to Reproduce

Steps to reproduce the behavior:
on a windows node:

  1. ensure registry key HKLM\SOFTWARE\Policies\Microsoft\PowerShellCore\Transcription\EnableTranscripting either does not exist or = 0
  2. extract attached example module .zip to C:\ProgramData\PuppetLabs\code\environments\production\modules
  3. in a terminal window, run:

    puppet apply -e "include example" --test

  4. console output will contain the message 'this uses the pwsh provider', along with 'executed successfully'
  5. set registry key HKLM\SOFTWARE\Policies\Microsoft\PowerShellCore\Transcription\EnableTranscripting = 1
  6. repeat terminal command:

    puppet apply -e "include example" --test

  7. console output will no longer contain the message 'this uses the pwsh provider'. 'executed successfully' still appears.

Environment

replicated against:

  • puppet agent version 5.5.16,
  • powershell module 3.0.1 & 6.0.0
  • windows server 2019

Additional Context

example.zip

Using exec provider 'powershell' successfully returns the script output, even with automatic transcription enabled. Automatic transcription for standard Windows Powershell is enabled through a Group Policy item, however Powershell Core does not obey this setting, instead requiring it to be enabled in the registry as above.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the pwsh provider and an Exec resource using puppet apply on Windows, first with transcription disabled and then with EnableTranscripting set to 1. Trace how command output is returned when logoutput => true, and confirm that the output appears in the console or event viewer in both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.