# Show number separately

**URL:** <https://forums.powershell.org/t/show-number-separately/20234>\
**Category:** PowerShell Help\
**Created:** [August 23, 2022, 12:20pm UTC](https://forums.powershell.org/t/show-number-separately/20234 "2022-08-23T12:20:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![deuval](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@deuval](https://forums.powershell.org/u/deuval)\
**Post date:** [August 23, 2022, 12:20pm UTC](https://forums.powershell.org/t/show-number-separately/20234/1 "2022-08-23T12:20:12Z")

</div>

hello  
i have somme difficulties to catch my screens serial number.

```auto
$i=0
 #find serial numbers

    $numSerie=gwmi -computerName $env:computername WmiMonitorID -Namespace root\wmi | ForEach-Object {($_.SerialNumberID -ne 0 | foreach {[char]$_}) -join ''} 

    write-host "serial numbers : $numSerie"
    write-host "number of screen : $($numSerie.Count)"
    write-host "value i : $i"
    write-host "serial numbers : $($numSerie)"

    for($i=0;$i -lt $($numSerie.Count);$i++){   
        if(($($numSerie[$i]) -ne 0))
        { 
write-host "serial number :$($numSerie[$i]) "}

```

le variable $numSerie works well. But i have probleme to read each serial number separately. Syntax yet, how can i do ?

---

<div class="post-metadata">

**Author:** ![PoshDad](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/poshdad/32/2626_2.png) [@PoshDad](https://forums.powershell.org/u/PoshDad)\
**Post date:** [August 23, 2022, 5:33pm UTC](https://forums.powershell.org/t/show-number-separately/20234/2 "2022-08-23T17:33:43Z")

</div>

It looks like Mike Robbins wrote a function for this. I would give this a try, I tested it on my machine to ensure it works. Mike Robbins is a well known Powershell expert and I personally trust his code.

[PowerShell Gallery | Get-MrMonitorInfo.ps1 0.3.1]([PowerShell Gallery | Get-MrMonitorInfo.ps1 0.3.1](https://www.powershellgallery.com/packages/MrIronScripter/0.3.1/Content/Get-MrMonitorInfo.ps1)

---

<div class="post-metadata">

**Author:** ![deuval](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@deuval](https://forums.powershell.org/u/deuval)\
**Post date:** [August 23, 2022, 7:08pm UTC](https://forums.powershell.org/t/show-number-separately/20234/3 "2022-08-23T19:08:22Z")

</div>

thanks for the precious link !

i thinks i have an idea. I need use a foreach object, not a for loop, to do what i want.

---

<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:16pm UTC](https://forums.powershell.org/t/show-number-separately/20234/4 "2024-05-16T20:16:45Z")

</div>

Closed on May 16, 2024, 8:16pm UTC


