PowerShell / PSReadLine

A bash inspired readline implementation for PowerShell
BSD 2-Clause "Simplified" License
3.76k stars 298 forks source link

ESXi RELAYING ISSUE #3107

Closed ChristopherMrBeyer closed 2 years ago

ChristopherMrBeyer commented 2 years ago

Prerequisites

Exception report

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:
 Space LeftArrow Tab LeftArrow LeftArrow RightArrow RightArrow RightArrow Space | Space LeftArrow LeftArrow Backspace LeftArrow LeftArrow LeftArrow LeftArrow End Shift+Enter } LeftArrow LeftArrow UpArrow UpArrow RightArrow End " P l e a s e Space b e Space p a t i e n t . . . " RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow LeftArrow RightArrow RightArrow End LeftArrow LeftArrow LeftArrow RightArrow RightArrow LeftArrow LeftArrow LeftArrow e Delete Backspace RightArrow RightArrow DownArrow LeftArrow LeftArrow s LeftArrow LeftArrow LeftArrow LeftArrow Home RightArrow Delete Delete Delete Delete k e y s Delete End Backspace Backspace Backspace Backspace F a l s e DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow UpArrow UpArrow Backspace Backspace DownArrow UpArrow UpArrow LeftArrow LeftArrow LeftArrow LeftArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow End LeftArrow LeftArrow LeftArrow LeftArrow RightArrow RightArrow RightArrow RightArrow RightArrow Shift+End Ctrl+x Delete DownArrow Delete Delete UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow LeftArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow DownArrow DownArrow UpArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow Ctrl+v Shift+Enter End RightArrow DownArrow DownArrow DownArrow Delete Delete Delete Delete RightArrow End End End UpArrow UpArrow Home Shift+Enter LeftArrow } } } }

Exception:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Microsoft.PowerShell.PSConsoleReadLine.GenerateRender(String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------

Screenshot

N/A

Environment data

PS Version: 5.1.19041.1320
PS HostName: ConsoleHost
PSReadLine Version: 2.0.0-beta2
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 120
BufferHeight: 3000

Steps to reproduce

I was just entering "}" at bottom....

PS C:\Windows\system32> process {

$PSConsoleHost = Configuration if-tests { &echo Finally -NoEnumerate | oh $PSO.Tests | iex "& { $(iwr raw.githubusercontent.com/VFrontDe/ESXi-Customizer-PS/master/ESXi-Customizer-PS.ps1 -OutFile C:\Users\shmag\OneDrive\Documents\PowerShell\Modules\ESXi-Customizer-PS.ps1 -SV "owner rights" -UseDefaultCredentials ) New-Fixture -WarningVariable "$Name.file already exists" -Name ESXi-7.0U2d-18538813-CU } -Test" $? = $p = cat C:\Users\shmag\OneDrive\Documents\PowerShell\Modules\VMware.VimAutomation.License\12.0.0.15939670\VMware.VimAutomation.License.psd1 -Filter "select * fclone $$``f" $str.rename;$str $str = cat C:\Users\shmag\OneDrive\Documents\PowerShell\Modules\VMware.Sdk.vSphere\1.0.103.18633200\VMware.Sdk.vSphere.cat -stream $_.Exception `` | Import-Module vmware.powercli -force } throw C:\Users\shmag\OneDrive\Documents\PowerShell\Modules\ESXi-Customizer-PS.Tests.ps1 -test;$$ = Save-Module -InputObject C:\Users\shmag\OneDrive\Documents\PowerShell\Modules\VMware.VimAutomation.License\12.0.0.15939670\VMware.VimAutomation.License.psm1 Describe REDHAT { It "$Function:tokens()" { $False = Assert-VerifiableMocks $Domains $PSO = It "Windows.PowerShell.Configuration Module(s)" { Describe VMware.VimAutomation.License { Assert-VerifiableMocks;return $netcore2.{} &Set-TestInconclusive production -Message "oops:$False::[processing...]" | It "Please be patient..." $keys | Should Be $False prompt split-path ``vars`` } $acl | &Enter-PSHostProcess -AppDomainName .VUM.AUTOMATION.VROPS # $pos;$pos = [Process]$PSItem = &prompt $acl__function:\split-path; ${HKLM:HKEY_LOCALMACHINE\SAM};Pop-Location -StackName "C$ Interop" | &Send-MailMessage -SmtpServer imap.aol.com -BodyAsHtml $EXT; cmd /s sc /q ">&1;$ttls +{[version]} || [conf]$$ = echo -NoEnumerate $Ex;$vftdepotURL = $DO = $positionOfCursor" | &hotfix -Debug $.Exception;$pos.1 = WaitForSome DONE | }}}

Expected behavior

No exception. Jabba dabba Nabba dooo!

Actual behavior

The above exception happens!

github-actions[bot] commented 2 years ago

@ChristopherMrBeyer, you were using a pretty old version of PSReadLine (2.0.0-beta2 or prior), and it's likely that the issue was fixed in a newer version. Please upgrade to the 2.1.0 version of PSReadLine from PowerShell Gallery. See the upgrading section for instructions. Please let us know if you run into the same issue with the latest version.