diff --git a/Dynamic Folder/Attached Serial Devices/Attached Serial Devices (PowerShell - Windows & Mac).rdfx b/Dynamic Folder/Attached Serial Devices/Attached Serial Devices (PowerShell - Windows & Mac).rdfx new file mode 100644 index 0000000..9c59913 --- /dev/null +++ b/Dynamic Folder/Attached Serial Devices/Attached Serial Devices (PowerShell - Windows & Mac).rdfx @@ -0,0 +1,162 @@ + + Dynamic Folder Export + + + DynamicFolder + Attached Serial Devices + Version 2.2. Compatible with Windows or Mac. This script utilizes PowerShell to generate a list of available serial devices, along with RTS Custom Properties defining speeds and framing settings, to generate a set of Terminal connections for each combination of port/speed/framing. + + + + + + + + +

+ Attached Serial Devices Dynamic Folder

+

This script utilizes PowerShell to generate a list of available serial devices, along with RTS Custom Properties defining speeds and framing settings, to generate a set of Terminal connections for each combination of port/speed/framing.

The resulting folder structure will look something like the following:

Attached Serial Devices

|-- USB Serial Device (COM12)

|   |-- COM12 9600 8N1

|   |-- COM12 9600 7E1

|   |-- COM12 19200 8N1

|   `-- COM12 19200 7E1

`-- USB-SERIAL CH340 (COM34)

    |-- COM34 9600 8N1

    |-- COM34 9600 7E1

    |-- COM34 19200 8N1

    `-- COM34 19200 7E1

+ Requirements

+

Installation of PowerShell for Mac OS.

Setting the exection policy of PowerShell to Remote Signed for Windows.

+ Custom Properties

+

+ Port Speeds

+

This field must contain comma-separated list of serial port speeds in numeric format.

    +
  • Example 1: 9600
  • Example 2: 9600,19200,115200
+

+ Frame Settings

+

This field must contain comma-separated list of serial port framing standards (8N1, 7E1, etc) in alphanumeric format, and each entry must be in double quotes.

    +
  • Example 1: "8N1"
  • Example 2: "8N1","7E1"
+

 

+ +]]>
+ + + Port Speeds + Text + 9600,19200,115200 + + + Frame Settings + Text + "8N1","7E1" + + + powershell + + json +
+
+
\ No newline at end of file diff --git a/Dynamic Folder/Microsoft/Windows/AttachedSerialDevices (Windows PowerShell).md b/Dynamic Folder/Microsoft/Windows/AttachedSerialDevices (Windows PowerShell).md deleted file mode 100644 index 184e733..0000000 --- a/Dynamic Folder/Microsoft/Windows/AttachedSerialDevices (Windows PowerShell).md +++ /dev/null @@ -1,39 +0,0 @@ -# Attached Serial Devices Dynamic Folder - -This script utilizes PowerShell to generate a list of available serial devices, along with RTS Custom Properties defining speeds and framing settings, to generate a set of Terminal connections for each combination of port/speed/framing. - -The resulting folder structure will look something like the following: - -``` -Attached Serial Devices -|-- USB Serial Device (COM12) -| |-- COM12 9600 8N1 -| |-- COM12 9600 7E1 -| |-- COM12 19200 8N1 -| `-- COM12 19200 7E1 -`-- USB-SERIAL CH340 (COM34) - |-- COM34 9600 8N1 - |-- COM34 9600 7E1 - |-- COM34 19200 8N1 - `-- COM34 19200 7E1 -``` - -## Requirements - -This solution only works under Windows due to its use of WMI to identify available COM ports. - -## Custom Properties - -### Port Speeds - -This field must contain comma-separated list of serial port speeds in numeric format. - -* **Example 1**: `9600` -* **Example 2**: `9600,19200,115200` - -### Frame Settings - -This field must contain comma-separated list of serial port framing standards (8N1, 7E1, etc) in alphanumeric format, and each entry must be in double quotes. - -* **Example 1**: `"8N1"` -* **Example 2**: `"8N1","7E1"` diff --git a/Dynamic Folder/Microsoft/Windows/AttachedSerialDevices (Windows PowerShell).rdfe b/Dynamic Folder/Microsoft/Windows/AttachedSerialDevices (Windows PowerShell).rdfe deleted file mode 100644 index bb55712..0000000 --- a/Dynamic Folder/Microsoft/Windows/AttachedSerialDevices (Windows PowerShell).rdfe +++ /dev/null @@ -1 +0,0 @@ -{"Name":"Dynamic Folder Export","Objects":[{"Type":"DynamicFolder","Name":"Attached Serial Devices","Description":"This script utilizes PowerShell to generate a list of available serial devices, along with RTS Custom Properties defining speeds and framing settings, to generate a set of Terminal connections for each combination of port/speed/framing.","Notes":"\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t

\r\n\t\t\tAttached Serial Devices Dynamic Folder

\r\n\t\t

This script utilizes PowerShell to generate a list of available serial devices, along with RTS Custom Properties defining speeds and framing settings, to generate a set of Terminal connections for each combination of port/speed/framing.

The resulting folder structure will look something like the following:

Attached Serial Devices

|-- USB Serial Device (COM12)

|   |-- COM12 9600 8N1

|   |-- COM12 9600 7E1

|   |-- COM12 19200 8N1

|   `-- COM12 19200 7E1

`-- USB-SERIAL CH340 (COM34)

    |-- COM34 9600 8N1

    |-- COM34 9600 7E1

    |-- COM34 19200 8N1

    `-- COM34 19200 7E1

\r\n\t\t\tRequirements

\r\n\t\t

This solution only works under Windows due to its use of WMI to identify available COM ports.

\r\n\t\t\tCustom Properties

\r\n\t\t

\r\n\t\t\tPort Speeds

\r\n\t\t

This field must contain comma-separated list of serial port speeds in numeric format.

\r\n\t\t

\r\n\t\t\tFrame Settings

\r\n\t\t

This field must contain comma-separated list of serial port framing standards (8N1, 7E1, etc) in alphanumeric format, and each entry must be in double quotes.

\r\n\t\t

 

\r\n\r\n","CustomProperties":[{"Name":"Port Speeds","Type":"Text","Value":"9600,19200,115200"},{"Name":"Frame Settings","Type":"Text","Value":"\"8N1\",\"7E1\""}],"ScriptInterpreter":"powershell","DynamicCredentialScriptInterpreter":"json","Script":"$ErrorActionPreference = \"Stop\"\r\n$comPortSpeeds = @($CustomProperty.PortSpeeds$)\r\n$comPortFrameSettings = @($CustomProperty.FrameSettings$)\r\n# Collect a list of avilable serial ports from WMI. See here for discussion: https://stackoverflow.com/questions/19840811/list-of-serialports-queried-using-wmi-differs-from-devicemanager\r\n$comPorts = Get-WmiObject -query 'SELECT * FROM Win32_PnPEntity WHERE ClassGuid=\"{4d36e978-e325-11ce-bfc1-08002be10318}\"'\r\n$folders = @()\r\nForEach ($comPort in $comPorts) {\r\n $connections = @()\r\n $comPortCaption = $comPort.Caption;\r\n if ($comPortCaption -match '.*\\((COM\\d+)\\)') {\r\n $comPortDevice = $Matches[1]\r\n }\r\n else {\r\n continue\r\n }\r\n ForEach ($comPortSpeed in $comPortSpeeds) {\r\n ForEach ($comPortFrameSetting in $comPortFrameSettings) {\r\n if ($comPortFrameSetting -match '^(\\d)([NOEMSnoems])(\\d)$') {\r\n [int]$comPortDataBits = $Matches[1]\r\n $comPortParityAlpha = $Matches[2].ToUpper()\r\n [int]$comPortStopBits = $Matches[3]\r\n }\r\n else {\r\n continue\r\n }\r\n if ($comPortParityAlpha -eq \"N\") {\r\n [int]$comPortParity = \"0\"\r\n }\r\n elseif ($comPortParityAlpha -eq \"O\") {\r\n [int]$comPortParity = \"1\"\r\n }\r\n elseif ($comPortParityAlpha -eq \"E\") {\r\n [int]$comPortParity = \"2\"\r\n }\r\n elseif ($comPortParityAlpha -eq \"M\") {\r\n [int]$comPortParity = \"3\"\r\n }\r\n elseif ($comPortParityAlpha -eq \"S\") {\r\n [int]$comPortParity = \"4\"\r\n }\r\n else {\r\n continue\r\n }\r\n $connectionProperties = New-Object PSCustomObject -Property @{\r\n \"BaudRate\" = $comPortSpeed;\r\n \"DataBits\" = $comPortDataBits;\r\n \"Parity\" = $comPortParity;\r\n \"StopBits\" = $comPortStopBits;\r\n }\r\n $connection = New-Object PSCustomObject -Property @{\r\n \"Type\" = \"TerminalConnection\";\r\n \"TerminalConnectionType\" = \"SerialPort\";\r\n \"Name\" = \"$comPortDevice $comPortSpeed $comPortFrameSetting\";\r\n \"SerialPortName\" = $comPortDevice;\r\n \"Properties\" = $connectionProperties;\r\n }\r\n $connections += $connection\r\n }\r\n }\r\n $folder = New-Object PSCustomObject -Property @{\r\n \"Type\" = \"Folder\";\r\n \"Name\" = $comPortCaption;\r\n \"Objects\" = $connections;\r\n }\r\n $folders += $folder\r\n}\r\n@{ Objects = $folders } | ConvertTo-Json -Depth 5"}]} \ No newline at end of file