{"action":"created","issue":{"url":"https://api.github.com/repos/lzybkr/PSReadLine/issues/310","labels_url":"https://api.github.com/repos/lzybkr/PSReadLine/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/lzybkr/PSReadLine/issues/310/comments","events_url":"https://api.github.com/repos/lzybkr/PSReadLine/issues/310/events","html_url":"https://github.com/lzybkr/PSReadLine/issues/310","id":120073347,"number":310,"title":"Exception: System.IO.IOException: The handle is invalid.","user":{"login":"6DAVEROO9","id":12588334,"avatar_url":"https://avatars.githubusercontent.com/u/12588334?v=3","gravatar_id":"","url":"https://api.github.com/users/6DAVEROO9","html_url":"https://github.com/6DAVEROO9","followers_url":"https://api.github.com/users/6DAVEROO9/followers","following_url":"https://api.github.com/users/6DAVEROO9/following{/other_user}","gists_url":"https://api.github.com/users/6DAVEROO9/gists{/gist_id}","starred_url":"https://api.github.com/users/6DAVEROO9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6DAVEROO9/subscriptions","organizations_url":"https://api.github.com/users/6DAVEROO9/orgs","repos_url":"https://api.github.com/users/6DAVEROO9/repos","events_url":"https://api.github.com/users/6DAVEROO9/events{/privacy}","received_events_url":"https://api.github.com/users/6DAVEROO9/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lzybkr/PSReadLine/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/lzybkr/PSReadLine/labels/duplicate","name":"duplicate","color":"cccccc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-03T01:20:05Z","updated_at":"2015-12-03T17:08:49Z","closed_at":"2015-12-03T17:08:49Z","body":"Complete error section is:\r\n-----------------------------------------------------------------------\r\nLast 0 Keys:\r\n\r\n\r\nException:\r\nSystem.IO.IOException: The handle is invalid.\r\n\r\n   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n   at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)\r\n   at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)\r\n   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)\r\n-----------------------------------------------------------------------\r\n\r\nScript that was being worked on is:\r\n\r\nPowerShell.exe -windowstyle hidden \r\n{$msgtxt = \"This will only take a moment. Click `\"OK`\" to begin.\"\r\n [System.Reflection.Assembly]::LoadWithPartialName(\"System.Windows.Forms\")\r\n $output = [System.Windows.Forms.MessageBox]::Show($msgtxt, \"Status\", 1) #0-OK 1-OK/Cancel 2-Abort/Retry/Ignore 3-Yes/No/Cancel 4-Yes/No 5-Retry/Cancel\r\n if($output -eq \"OK\")\r\n  {$clkspd = Get-WmiObject Win32_Processor | Select-Object -ExpandProperty MaxClockSpeed\r\n   $clkspd = $clkspd/1000\r\n   $totmem = Get-WMIObject Win32_PhysicalMemory | Measure-Object -Property capacity -Sum | Select-Object -ExpandProperty Sum\r\n   $totmem = $totmem/1024/1024/1024\r\n   $fremem = Get-WmiObject Win32_OperatingSystem | select FreePhysicalMemory\r\n   $fremem = $fremem/1024/1024 | % {$_.ToString(\"#.##\")}\r\n   $msgtxt = \"Computer Name: \"\r\n   $msgtxt += $(Get-WmiObject Win32_Computersystem).name\r\n   $msgtxt += \"`n`n\"\r\n   $msgtxt += $(Get-WmiObject Win32_BIOS).name\r\n   $msgtxt += \"`n`n\"\r\n   $msgtxt += \"Processor: \"\r\n   $msgtxt += Get-WmiObject Win32_Processor | Select-Object -ExpandProperty Name\r\n   $msgtxt += \"$clkspd MHz `n`n\"\r\n   $msgtxt += \"Memory Manufacturer (one name per slot): \"\r\n   $msgtxt += Get-WmiObject CIM_PhysicalMemory | Select-Object -ExpandProperty Manufacturer\r\n   $msgtxt += \"`n`n\"\r\n   $msgtxt += \"Total Physical Memory: $totmem GB   Total Free Memory: $fremem GB\"\r\n   $msgtxt +=\r\n   [System.Windows.Forms.MessageBox]::Show($msgtxt, \"System Specs\", 0)\r\n  }\r\n}\r\n\r\nSection from first instance of $clkspd to the second instance of $fremem is the one I was working on at the time of the crash. Crash was preceded by the error:\r\nMethod invocation failed because [System.Management.Automation.PSObject] does not contain a method named 'op_Division'. Internet search mentioned initialization of variable that is its own operator. Tried by making the all the variables in question = @(), as well as = 0.0. It was after returning to the above script that the crash occurred."},"comment":{"url":"https://api.github.com/repos/lzybkr/PSReadLine/issues/comments/161718427","html_url":"https://github.com/lzybkr/PSReadLine/issues/310#issuecomment-161718427","issue_url":"https://api.github.com/repos/lzybkr/PSReadLine/issues/310","id":161718427,"user":{"login":"lzybkr","id":2148248,"avatar_url":"https://avatars.githubusercontent.com/u/2148248?v=3","gravatar_id":"","url":"https://api.github.com/users/lzybkr","html_url":"https://github.com/lzybkr","followers_url":"https://api.github.com/users/lzybkr/followers","following_url":"https://api.github.com/users/lzybkr/following{/other_user}","gists_url":"https://api.github.com/users/lzybkr/gists{/gist_id}","starred_url":"https://api.github.com/users/lzybkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzybkr/subscriptions","organizations_url":"https://api.github.com/users/lzybkr/orgs","repos_url":"https://api.github.com/users/lzybkr/repos","events_url":"https://api.github.com/users/lzybkr/events{/privacy}","received_events_url":"https://api.github.com/users/lzybkr/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T17:08:49Z","updated_at":"2015-12-03T17:08:49Z","body":"This looks a lot like #158, I'll close it as a dupe, you can reactivate it if I'm wrong, or if the eventual fix doesn't address your issue."}}