Azure / Azure/azure-powershell

`Az.Tools.Predictor` + `PSReadLine` randomly runs something in the terminal

Open
#23,573 3 comments 0 reactions 1 assignee Claimed by @dolauli View on GitHub
Azure PS Team bug customer-reported Investigate :mag:
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

I've had the same issue with `Az.Accounts` earlier. Thought it was `vscode-powershell`s fault, but seems it was `Az`.

* 2023-10-06: https://github.com/PowerShell/vscode-powershell/issues/4773

Here's what happened today: I started writing down a script to `Get-AzSentinelDataConnector`. Suddenly the terminal outputs the following and won't finish/quit unless I do CTRL+C:

```
PS C:\Users\olav.birkeland\OneDrive\IT\Code> PipelineStoppedException: The pipeline has been stopped.
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Boolean propagateAllExceptionsToTop, List`1 variablesToDefine, Dictionary`2 functionsToDefine, Object[] args)
at System.Management.Automation.ScriptBlock.DoInvokeReturnAsIs(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Object[] args)
at System.Management.Automation.CommandInvocationIntrinsics.InvokeScript(ScriptBlock sb, Boolean useNewScope, PipelineResultTypes writeToPipeline, IList input, Object[] args)
at System.Management.Automation.CommandInvocationIntrinsics.InvokeScript(String script)
at Microsoft.Azure.PowerShell.Cmdlets.SecurityInsights.Runtime.PowerShell.PsHelpers.RunScript[T](CommandInvocationIntrinsics cii, String script)
at Microsoft.Azure.PowerShell.Cmdlets.SecurityInsights.Runtime.PowerShell.PsExtensions.RunScript[T](PSCmdlet cmdlet, String script)
at Microsoft.Azure.PowerShell.Cmdlets.SecurityInsights.Runtime.PowerShell.PsHelpers.GetScriptCmdlets(PSCmdlet cmdlet, String scriptFolder)
at Microsoft.Azure.PowerShell.Cmdlets.SecurityInsights.Runtime.PowerShell.GetScriptCmdlet.ProcessRecord()
^C
PS C:\Users\olav.birkeland\OneDrive\IT\Code>
```

### Issue script & Debug output

```PowerShell
I can't reliably reproduce it.
```

### Environment data

* Windows 11 23H2
* PowerShell v7.4.0 x64 from MSI installer
* `vscode-powershell` v2023.8.0

### Module versions

```PowerShell
Az.Accounts v2.13.2
Az.SecurityInsights v3.1.1
```

### Error output

```PowerShell
No output.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.