PowerShell / PowerShell/vscode-powershell

ConvertTo-SecureString hangs PowerShell host when run in the VS Code debugger within a local Azure Function host

Open
#2,050 4 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Debugging Issue-Bug
Dominant language
TypeScript
Stars
1.9k
Forks
547
PR merge metrics
No merged PRs in 30d

Description

If you run the below code without using Wait-Debugger then it will run correctly without issue:

param($Request, $TriggerMetadata)

Wait-Debugger
$EncryptString = "eamon"
Write-Output $EncryptString

$TestSecure = ConvertTo-SecureString -String $EncryptString -AsPlainText -Force

$TestSecure
If you run it with Wait-Debugger enabled, it will not complete and crash the PowerShell host.

Please refer to https://github.com/Azure/azure-functions-powershell-worker/issues/259 for additional context.

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

Reproduce the issue in the local Azure Function host using the PowerShell snippet with Wait-Debugger enabled, then compare it with the version that omits Wait-Debugger. Review the linked azure-functions-powershell-worker issue for context; done means the ConvertTo-SecureString call completes without hanging or crashing the PowerShell host.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell, vscode
Domain
cloud, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.