Skip to content
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

PSCore 6.1.0-GA Linux and MacOS Ctrl-V large code giving System.ArgumentOutOfRangeException. #810

Closed
MaximoTrinidad opened this issue Nov 10, 2018 · 1 comment

Comments

@MaximoTrinidad
Copy link

Environment data

Linux - Ubuntu 18.04

PS /home/maxt> cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

PS version: 6.1.0
PSReadline version: 2.0.0-beta3
os: Linux mars 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
PS file version: 

MacOS High Sierra

PS version: 6.1.0
PSReadline version: 2.0.0-beta2
os: Darwin kronos.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
PS file version: 

Steps to reproduce or exception report

Copy/Paste a modified code code from the following link: https://docs.microsoft.com/en-us/powershell/azure/uninstall-azurerm-ps?view=azurermps-6.12.0.

function Uninstall-AllModules
{
	[CmdletBinding(SupportsShouldProcess)]
	param (
		[Parameter(Mandatory = $true)]
		[string]
		$TargetModule,
		[Parameter(Mandatory = $true)]
		[string]
		$Version,
		[switch]
		$Force
	)
	
	$AllModules = @()
	
	'Creating list of dependencies...'
	$target = Find-Module $TargetModule -RequiredVersion $version
	$target.Dependencies | ForEach-Object {
		$AllModules += New-Object -TypeName psobject -Property @{ name = $_.name; version = $_.minimumVersion }
	}
	$AllModules += New-Object -TypeName psobject -Property @{ name = $TargetModule; version = $Version }
	
	$cnt = 1;
	foreach ($module in $AllModules)
	{
		Write-Host ("[$cnt] - " + 'Uninstalling {0} version {1}' -f $module.name, $module.version);
		$cnt++;
		try
		{
			if ($PSCmdlet.ShouldProcess($_.name, 'Uninstall'))
			{
				$_ | Select-Object Name, Version;
			}
			else
			{
				Uninstall-Module -Name $module.name -RequiredVersion $module.version -Force:$Force -ErrorAction Stop
			}
		}
		catch
		{
			Write-Host ("`t" + $_.Exception.Message)
		}
	}
};

It will generate the following error:

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:

; Enter
Tab Tab Tab } Enter
Tab Tab Tab e l s e Enter
Tab Tab Tab { Enter
Tab Tab Tab Tab U n i n s t a l l - M o d u l e Space - N a m e Space $ m o d u l e . n a m e Space - R e q u i r e d V e r s i o n Space $ m o d u l e . v e r s i o n Space - F o r c e : $ F o r c e Space - E r r o r A c t i o n Space S t o p Enter
Tab Tab Tab } Enter
Tab Tab } Enter
Tab Tab c a t c h Enter
Tab Tab { Enter
Tab Tab Tab W r i t e - H o s t Space ( " ` t " Space + Space $ _ . E x c e p t i o n . M e s s a g e ) Enter
Tab Tab } Enter
Tab } Enter
} Enter
Enter


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 -7.
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.AcceptLineImpl(Boolean validate)
at Microsoft.PowerShell.PSConsoleReadLine.AcceptLine(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, CancellationToken cancellationToken)

-----------------------------------------------------------------------

psreadline_issue_01_2018-11-10_12-44-09
psreadline_issue_02_2018-11-10_12-44-09

@MaximoTrinidad MaximoTrinidad changed the title PSCore 6.1.0-GA Ubuntu Ctrl-V large code giving System.ArgumentOutOfRangeException. PSCore 6.1.0-GA Linux and MacOS Ctrl-V large code giving System.ArgumentOutOfRangeException. Nov 10, 2018
@lzybkr
Copy link
Member

lzybkr commented Nov 13, 2018

Duplicate of #663

@lzybkr lzybkr marked this as a duplicate of #663 Nov 13, 2018
@lzybkr lzybkr closed this as completed Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants