Last active
October 21, 2016 22:18
-
-
Save matthewjberger/8bec7d3689afaa1501d995dcc1f22f49 to your computer and use it in GitHub Desktop.
This will generate an html table that lists available COM ports on windows. It can be styled with css.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Multi-Line | |
$style = @" | |
<style type="text/css"> | |
th { | |
background: lightblue | |
} | |
tr { | |
text-align:left | |
} | |
table, th, td{ | |
border: 1px solid black; | |
} | |
</style> | |
"@ | |
Get-WMIObject Win32_SerialPort | ` | |
Select-Object DeviceID,Name,Description | ` | |
Sort-Object DeviceID | ` | |
ConvertTo-HTML -Head $style | |
# One Line | |
Get-WMIObject Win32_SerialPort | Select-Object DeviceID,Name,Description | Sort-Object DeviceID | ConvertTo-HTML -Head $style | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment