Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support the "env" key in launch.json for debugging Environment Variable setup #4998

Open
2 tasks done
johngladp opened this issue May 29, 2024 · 1 comment
Labels
Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.

Comments

@johngladp
Copy link

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.

Summary

When debugging PowerShell scripts it is necessary at times to set environment variables to be used for given debug configuration.

This use-case is especially necessary when debugging scripts that are to be used in conjunction with Azure devops YAML pipelines as all pipeline variables are environment variables. Example: Where we have multiple pipeline steps emitting variables (YAML template expression "each" usage) and we use a PowerShell script to gather the outputs for processing and formatting (YAML template expression "join" used to pass parameters to the PowerShell script). Debugging this use-case is harder than it needs to be right now and suggested work arounds, whilst usable, are cumbersome.

Proposed Design

Support for an "env" key for "PowerShell" debugging as per other configuration types please, e.g.
image

@johngladp johngladp added Issue-Enhancement A feature request (enhancement). Needs: Triage Maintainer attention needed! labels May 29, 2024
@JustinGrote
Copy link
Collaborator

Thanks for the submission! Have you considered using a pester test and setting up the env variables in that? You can then debug the pester test either with the codelens or with the Pester Tests extension.

That said, this could be possible but there's a lot of considerations for cleanup, etc., I'll flag it as up for grabs.

@JustinGrote JustinGrote changed the title "env" key in launch.json configuration type: "PowerShell" is not supported. Feature Request: Support the "env" key in launch.json for debugging Environment Variable setup May 29, 2024
@SydneyhSmith SydneyhSmith added Up for Grabs Will shepherd PRs. and removed Needs: Triage Maintainer attention needed! labels Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.
Projects
None yet
Development

No branches or pull requests

3 participants