Skip to content

Hash table containing 10 custom PSObjects #1340

Closed
@bilscoman

Description

@bilscoman

Passing a hash table containing 10 custom psobjects to a function call resulted in the below error message.

$hostSyncHash = @{}
foreach ($line in $a ) {
$HostSyncObject = New-Object -TypeName psobject
$HostSyncObject | Add-Member -MemberType NoteProperty -Name "HostInTable" -value $line.HostInTable
$HostSyncObject | Add-Member -MemberType NoteProperty -Name "HostInFile" -value $line.hostinfile
$HostSyncObject | Add-Member -MemberType NoteProperty -Name "outtable" -value $line.outtable
$HostSyncObject | Add-Member -MemberType NoteProperty -Name "outfile" -value $line.outfile
$HostSyncObject | Add-Member -MemberType NoteProperty -Name "SqlFile" -value $line.SqlFile
$HostSyncObject | Add-Member -MemberType NoteProperty -Name "Delimiter" -value $Config.Settings.Delimiter
$HostSyncObject | Add-Member -MemberType NoteProperty -Name "InDir" -value $Config.Settings.HostInFileDir
$HostSyncObject | Add-Member -MemberType NoteProperty -Name "PrepDir" -value $Config.Settings.ScriptDir
$HostSyncObject | Add-Member -MemberType NoteProperty -Name "OutDir" -value $Config.Settings.HostOutFileDir
$HostSyncObject | Add-Member -MemberType NoteProperty -Name "CreateTables" -value $config.Settings.SqlCreateTables
$hostSyncHash.add($HostSyncObject.HostInTable, $HostSyncObject)
}

fillData $dt $SqlConnection $hostSyncHash

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:
o s t S y n c H a s h Space # Space f u n c t i o n Space t o Space a d d Space d a t a Space t o Space d a t a t a b l e Enter
Space Space Space Space Space Space $ d t c o u n t Space = Space $ d t Space | Space g m Space - m e m b e r t y p e Space P r o p e r t i e s Enter
Space Space Space Space Space Space $ d t i n d e x Space = Space $ d t c o u n t . l e n g t h Enter
Space Space Space Space Space Space $ f o r m H a s h . a d d ( $ d t . t a b l e n a m e , Space $ d t i n d e x Space ) Enter
Space Space Space Space Space Space Space Space Space Space Space Space } Enter
Space Space Space Space } Enter
Space Space Space Space

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 -11.
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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions