Skip to content

PSConsoleReadLine.ReadLine - ArgumentOutOfRangeException #725

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

Closed
Kinjara opened this issue Jul 10, 2018 · 3 comments
Closed

PSConsoleReadLine.ReadLine - ArgumentOutOfRangeException #725

Kinjara opened this issue Jul 10, 2018 · 3 comments
Labels
OutOfRange Issues relating to System.ArgumentOutOfRangeException Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@Kinjara
Copy link

Kinjara commented Jul 10, 2018

If I try to read the encryption-state of my Azure-VM; I get the error that the key does not exists.
To work-a-round this I want to try-catch that error and start the encryption process.

However I get the error 'something went wrong'

With kind regards,
Sebastian

Try

{
#Get-AzureRmVmDiskEncryptionStatus -ResourceGroupName $RGName -VMName $VMName
}
catch
{
f($.Exception.Message -like "The Resource 'Microsoft.Compute/virtualMachines/")
{
Continue;
}
else
{
throw $
.Exception
}
$Result = "Not encrypted"
}$Result3;1
Oops, something went wrong. Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new


Last 200 Keys:
Escape 1 3 ; 1 R

Exception:
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 -3.
at System.Console.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable1 key, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

@Kinjara
Copy link
Author

Kinjara commented Jul 10, 2018

if I remove the 'else' it doesn't go into the error.

@lzybkr
Copy link
Contributor

lzybkr commented Jul 11, 2018

This looks like a dupe of #663. Is [Console]::BufferHeight less than the number of lines of input?

@joeyaiello joeyaiello added the OutOfRange Issues relating to System.ArgumentOutOfRangeException label Jun 18, 2019
@daxian-dbw daxian-dbw added the Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. label Jul 19, 2019
@daxian-dbw
Copy link
Member

Close as a duplicate of #663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OutOfRange Issues relating to System.ArgumentOutOfRangeException Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

4 participants