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

Create 20 VMs with managed image #874

Closed
kaithedeveloper opened this issue Mar 25, 2019 · 1 comment
Closed

Create 20 VMs with managed image #874

kaithedeveloper opened this issue Mar 25, 2019 · 1 comment
Labels
OutOfRange Issues relating to System.ArgumentOutOfRangeException

Comments

@kaithedeveloper
Copy link

$counts=1,2,..20
$cred = Get-Credential
foreach ($count in $counts)
{
New-AzureRmVm -ResourceGroupName "CWUSStaging"
-Name "CWUS2-VG-Pax$i" -ImageName "PaxtonVmImage"
-Location "East US 2" -VirtualNetworkName "CWUS2Staging-vnet"
-SubnetName "default" -SecurityGroupName "CWUS2-VG-Pax01-nsg"
-PublicIpAddressName "myImagePIP$i" `
-OpenPorts 3389
-Credential $cred
}

If i ran that script in Azure Cloud shell i get 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:

 V i r t u a l N e t w o r k N a m e Space " C W U S 2 S t a g i n g - v n e t " Space ` Enter
 Space Space Space Space - S u b n e t N a m e Space " d e f a u l t " Space ` Enter
 Space Space Space Space - S e c u r i t y G r o u p N a m e Space " C W U S 2 - V G - P a x 0 1 - n s g " Space ` Enter
 Space Space Space Space - P u b l i c I p A d d r e s s N a m e Space " m y I m a g e P I P $ i " Space ` Enter
 Space Space Space Space - O p e n P o r t s Space 3 3 8 9 Enter
 Space Space Space Space - C r e d e n t i a l Space $ c r e d 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 -1.
   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(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, CancellationToken cancellationToken)

@daxian-dbw daxian-dbw added this to the 2.0.0-Consider milestone Jun 18, 2019
@joeyaiello joeyaiello added the OutOfRange Issues relating to System.ArgumentOutOfRangeException label Jun 18, 2019
@daxian-dbw
Copy link
Member

Fixed by #979

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
Projects
None yet
Development

No branches or pull requests

3 participants