-
Notifications
You must be signed in to change notification settings - Fork 513
System.ArgumentOutOfRangeException when using Out-GridView #2152
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
Comments
Not sure if this is related, but the following command also works in Windows PowerShell, but fails in VS Code: Get-AzVM -Name MGMT-AZ-01 | Invoke-AzVMRunCommand -CommandId RunPowerShellScript -ScriptPath "~\Git\PSDemo\Azure\sample.ps1" PS Git:> Get-AzVM -Name MGMT-AZ-01 | Invoke-AzVMRunCommand -CommandId RunPowerShellScript -ScriptPath "~\Git\PSDemo System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. PS Git:> Domain specific\Azure\sample.ps1" |
@janegilring thanks for reporting this it looks like you are hitting the same issue as #702 |
@janegilring are you able to reproduce this issue in our Preview Extension?...that extension has PSReadline support which may solve this issue |
@SydneyhSmith I installed the preview extension, and when trying to reproduce using that version - the issue is gone. If I go back to the non-preview extension, the issue is back. Are there any timeline for when PSReadline support will be available in the non-preview extension? |
@janegilring thanks for checking that, glad to hear you have a work-around option for now---we unfortunately dont have a committed deadline but it remains our top issue and one we are hoping will be solved by architecture changes we are currently implementing |
Going to mark this as a duplicate and continue tracking this item with our existing issue that PSReadLine is not available in the main PowerShell Extension #1793 |
This issue has been marked as duplicate and has not had any activity for 1 day. It has been closed for housekeeping purposes. |
Issue Description
The following works fine in the Windows PowerShell console host:
Connect-AzAccount -Credential $AzureCreds
Get-AzSubscription | Out-GridView -PassThru -Title 'Select subscription to operate against' | Set-AzContext
When I run the same in VS Code, I get the following error:
PS Git:> Get-AzSubscription | Out-GridView -PassThru -Title 'Select subscription to operate against' | Set-AzContext
An error occurred while reading input:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was 10.
at System.Console.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.PowerShell.EditorServices.Console.ConsoleReadLine.InsertInput(StringBuilder inputLine, Int32 promptStartCol, Int32 promptStartRow, String insertedInput, Int32 cursorIndex, Int32 insertIndex, Int32 replaceLength, Int32
finalCursorIndex)
at Microsoft.PowerShell.EditorServices.Console.ConsoleReadLine.d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.PowerShell.EditorServices.EditorServicesPSHostUserInterface.d__95.MoveNext()
Environment Information
Visual Studio Code
PowerShell Information
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
The text was updated successfully, but these errors were encountered: