# Strange Powershell 5.0 behaviour

**URL:** <https://forums.powershell.org/t/strange-powershell-5-0-behaviour/4639>\
**Category:** PowerShell Help\
**Created:** [August 6, 2015, 2:36am UTC](https://forums.powershell.org/t/strange-powershell-5-0-behaviour/4639 "2015-08-06T02:36:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![windows-liveuser47](https://avatars.discourse-cdn.com/v4/letter/w/f14d63/32.png) [@windows-liveuser47](https://forums.powershell.org/u/windows-liveuser47)\
**Post date:** [August 6, 2015, 2:36am UTC](https://forums.powershell.org/t/strange-powershell-5-0-behaviour/4639/1 "2015-08-06T02:36:35Z")

</div>

`
$NICs = Get-WmiObject Win32_NetworkAdapter | Where-Object {$_.PhysicalAdapter -eq $true}
$NICs | Select-Object Name, DeviceID
`

`$NICnumber = Read-Host “`nSelect Network Adapter”
`

When running the code above on PowerShell 4.0 it works normally, but when I try it on Powershell 5.0 the list of network cards isn’t displayed. Somehow Read-Host screws up the output, I also get the same result with “[Console]::ReadLine()”. Is this a bug or what?

---

<div class="post-metadata">

**Author:** ![richard-siddaway](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@richard-siddaway](https://forums.powershell.org/u/richard-siddaway)\
**Post date:** [August 6, 2015, 2:42am UTC](https://forums.powershell.org/t/strange-powershell-5-0-behaviour/4639/2 "2015-08-06T02:42:46Z")

</div>

I can’t reproduce your problem. Running your code on PowerShell 5 on Windows 10 RTM works for me

---

<div class="post-metadata">

**Author:** ![windows-liveuser47](https://avatars.discourse-cdn.com/v4/letter/w/f14d63/32.png) [@windows-liveuser47](https://forums.powershell.org/u/windows-liveuser47)\
**Post date:** [August 6, 2015, 2:45am UTC](https://forums.powershell.org/t/strange-powershell-5-0-behaviour/4639/3 "2015-08-06T02:45:56Z")

</div>

Strange, I got the same result on two different Machines.

---

<div class="post-metadata">

**Author:** ![daniel-krebs](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/daniel-krebs/32/484_2.png) [@daniel-krebs](https://forums.powershell.org/u/daniel-krebs)\
**Post date:** [August 6, 2015, 2:59am UTC](https://forums.powershell.org/t/strange-powershell-5-0-behaviour/4639/4 "2015-08-06T02:59:29Z")

</div>

I can reproduce it on Win10 RTM. The output of the Select-Object gets displayed after the Read-Host prompt instead of before.

You should submit a bug report via Connect - [http://connect.microsoft.com/powershell](http://connect.microsoft.com/powershell).

A workaround would be to use Format-Table to get the correct output.

`
$NICs = Get-WmiObject -Class Win32_NetworkAdapter |
    Where-Object { $_.PhysicalAdapter -eq $true }
$NICs | Format-Table -Property DeviceID, Name
`

`$NICNumber = Read-Host “`nSelect Network Adapter”
`

---

<div class="post-metadata">

**Author:** ![windows-liveuser47](https://avatars.discourse-cdn.com/v4/letter/w/f14d63/32.png) [@windows-liveuser47](https://forums.powershell.org/u/windows-liveuser47)\
**Post date:** [August 6, 2015, 3:21am UTC](https://forums.powershell.org/t/strange-powershell-5-0-behaviour/4639/5 "2015-08-06T03:21:36Z")

</div>

Thanks, I submitted it as bug to connect:  
[https://connect.microsoft.com/PowerShell/feedback/details/1635172/read-host-problems-in-powershell-5-0-10240-16384](https://connect.microsoft.com/PowerShell/feedback/details/1635172/read-host-problems-in-powershell-5-0-10240-16384)

---

<div class="post-metadata">

**Author:** ![richard-siddaway](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@richard-siddaway](https://forums.powershell.org/u/richard-siddaway)\
**Post date:** [August 6, 2015, 4:37am UTC](https://forums.powershell.org/t/strange-powershell-5-0-behaviour/4639/6 "2015-08-06T04:37:46Z")

</div>

Its a little more complicated than you stated as it works fine for me in the PowerShell console but I can reproduce the problem in ISE

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:45pm UTC](https://forums.powershell.org/t/strange-powershell-5-0-behaviour/4639/7 "2024-05-16T20:45:16Z")

</div>


