Some scripts fail in PS7
- Dominant language
- C#
- Stars
- 5
- Forks
- 3
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 14
Description
When running with PS7 in QA env controllservices.ps1 fails with following error (deployment ID - 1816135):
"[ERR] [PS] ErrorId: Microsoft.PowerShell.Commands.WriteErrorException,Get-DorcToken
Exception: Microsoft.PowerShell.Commands.WriteErrorException: Failed to retrieve token. Please check DorcIDSsecret variable value! Error: Unable to cast object of type 'System.Management.Automation.PSDataCollection1[System.Management.Automation.ProgressRecord]' to type 'System.Management.Automation.PSDataCollection1[System.Management.Automation.InformationRecord]'."
Based on my investigation the cause of the issue is following :
Wrong event wiring in DOrc.Cmd/dorc/src/Dorc.PowerShell/PowerShellScriptRunner.cs: Progress stream is subscribed to the Information handler.
Specifically line 61: powerShell.Streams.Progress.DataAdded += Powershell_Information_DataAdded;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.