-
Notifications
You must be signed in to change notification settings - Fork 511
Error on Integrated Console Start - PSInvalidOperationException Pipeline Issue #4048
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
Error on Integrated Console Start - PSInvalidOperationException Pipeline Issue #4048
Comments
Additional context:
I am not sure that this is an issue with PSReadLine or the PowerShell plugin in VS Code. Please let me know if you want me to migrate this issue to their repo. |
What happens if you load without profiles? |
The terminal loads without issue. Following this thread further, I narrowed down the issue to the following: # Attempt to load and start Az Predictor
try {
if ($PSVersionTable.PSVersion.Major -gt 5) {
Import-Module Az.Tools.Predictor
Set-PSReadLineOption -PredictionSource History
}
}
catch {
Write-Warning "An Error occurred loading Az Predictor: $($Error[0].Exception.Message)"
} Since these specific cmdlets were from when Az.Tools.Predictor was in preview, I thought I'd check the documentation and can see that they recommend a different approach to starting it: # Attempt to load and start Az Predictor
try {
if ($PSVersionTable.PSVersion.Major -gt 5) {
Enable-AzPredictor -AllSession
Set-PSReadLineOption -PredictionViewStyle InlineView
}
}
catch {
Write-Warning "An Error occurred loading Az Predictor: $($Error[0].Exception.Message)"
} Tried this which resulted in the same error. |
|
How about narrowing it down between: |
I think you'll need to not import |
Or set |
Sounds like @SeeminglyScience might have a fix. |
This issue was closed automatically as repro info was indicated as needed, but there has been no activity in over a week. Please feel free to reopen with any available information! |
Re-opening, have already provided repro info. |
Idea from Patrick: "When we create the initial PowerShell instance, we need to mark it as nested with RunspaceMode.CurrentRunspace. Will probably through an exception, will need to temporarily set a default runspace while we mark it as nested." Currently being done elsewhere in the code. In most cases we don't use the initial instance. Because this is being loaded in the profile specifically, it's hitting an OnIdle run before we've ran something else, hence using the non-nested runspace and failing. |
@dgcode I think I have a fix, I need to have @SeeminglyScience review it and then we'll test it with you in Preview. |
Sounds good, cheers! |
Prerequisites
Exception report
Screenshot
Environment data
Steps to reproduce
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: