Created
May 11, 2023 04:05
-
-
Save crozone/26f35f26106c0c4b48011989df8b8635 to your computer and use it in GitHub Desktop.
Open all serial ports in PuTTY
This file contains 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
# Powershell script to automatically open a putty window for each serial port on the computer | |
param ( | |
[string]$baud = "115200" | |
) | |
$serialreg = Get-Item -Path Registry::HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM | |
foreach ($thisname in $serialreg.GetValueNames()) | |
{ | |
$thisvalue = $serialreg.GetValue($thisname) | |
# Ignore Bluetooth virtual serial ports | |
if($thisname.StartsWith("\Device\Bt")) { | |
Write-Host "IGNORE "$thisname $thisvalue | |
continue | |
} | |
Write-Host "OPEN" $thisname $thisvalue | |
putty -sercfg $baud,8,n,1,N -serial $thisvalue | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment