Skip to content

Commit

Permalink
updated terminal prompt (#96)
Browse files Browse the repository at this point in the history
Updated the default terminal prompt for the 'SSH Execute Command' block from "(.*(~(.*[\r\n]?)\$|>))" to ".*[>|\$|#]"
  • Loading branch information
cortex-bt authored Jan 25, 2024
1 parent 9ee53a0 commit c4b7c26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This example will execute a [Command][Command Property] on the server with the f
| Property | Value | Notes |
|--------------------|---------------------------|------------------------------------------|
| [Command][Command Property] | `($)Command` with value `"ipconfig"` | `($)Command` is a variable of type [EncryptableText][] |
| [Ssh Session Details][Ssh Session Details Property] | `($)SshSessionDetails` with value `{"Host": "localhost", "Port": 22, "Credentials": {"Domain": "domain", "Username": "username", "Password": "encryptedPassword"}, "TerminalPrompt": "(.*(~(.*[\r\n]?)\$\|>))"}`<br><br>In this example `($)SshSessionDetails` has been set up using the following [Expression][]:<br><br> `new SshSessionDetails("localhost", 22, new UserCredentials("domain", "username", "encryptedPassword"), @"(.*(~(.*[\r\n]?)\$\|>))")` | `($)SshSessionDetails` is a variable of type [SshSessionDetails][] |
| [Ssh Session Details][Ssh Session Details Property] | `($)SshSessionDetails` with value `{"Host": "localhost", "Port": 22, "Credentials": {"Domain": "domain", "Username": "username", "Password": "encryptedPassword"}, "TerminalPrompt": ".*[>\|\$\|#]"}`<br><br>In this example `($)SshSessionDetails` has been set up using the following [Expression][]:<br><br> `new SshSessionDetails("localhost", 22, new UserCredentials("domain", "username", "encryptedPassword"), $@".*[>\|\$\|#]")` | `($)SshSessionDetails` is a variable of type [SshSessionDetails][] |
| [Close Session][Close Session Property] | `($)CloseSession` with value `true` | `($)CloseSession` is a variable of type [Boolean][] |
| [Configuration Settings][Configuration Settings Property] | `($)ConfigurationSettings`, with no value | `($)ConfigurationSettings` is a variable of type [Dictionary][]&lt;[String][], [EncryptableText][]&gt; |
| [Response][Response Property] | `($)Response`, with no value | `($)Response` will be set to the type [String][] |
Expand Down Expand Up @@ -85,7 +85,7 @@ The server can be connected to using a valid certificate.
| Property | Value | Notes |
|--------------------|---------------------------|------------------------------------------|
| [Command][Command Property] | `($)Command` with value `"ipconfig"` | `($)Command` is a variable of type [EncryptableText][] |
| [Ssh Session Details][Ssh Session Details Property] | `($)SshSessionDetails` with value `{"Host": "localhost", "Port": 22, "Credentials": {"Domain": "domain", "Username": "username", "CertificatePath": "C:\\Certificate.pfx", "CertificatePassword": "encryptedCertificatePassword"}, "TerminalPrompt": "(.*(~(.*[\r\n]?)\$\|>))"}`<br><br>In this example `($)SshSessionDetails` has been set up using the following [Expression][]:<br><br> `new SshSessionDetails("localhost", 22, new SshCertificateCredentials("domain", "username", @"C\Certificate.pfx", "encryptedCertificatePassword"), @"(.*(~(.*[\r\n]?)\$\|>))")` | `($)SshSessionDetails` is a variable of type [SshSessionDetails][] |
| [Ssh Session Details][Ssh Session Details Property] | `($)SshSessionDetails` with value `{"Host": "localhost", "Port": 22, "Credentials": {"Domain": "domain", "Username": "username", "CertificatePath": "C:\\Certificate.pfx", "CertificatePassword": "encryptedCertificatePassword"}, "TerminalPrompt": ".*[>\|\$\|#]"}`<br><br>In this example `($)SshSessionDetails` has been set up using the following [Expression][]:<br><br> `new SshSessionDetails("localhost", 22, new SshCertificateCredentials("domain", "username", @"C\Certificate.pfx", "encryptedCertificatePassword"), $@".*[>\|\$\|#]")` | `($)SshSessionDetails` is a variable of type [SshSessionDetails][] |
| [Close Session][Close Session Property] | `($)CloseSession` with value `true` | `($)CloseSession` is a variable of type [Boolean][] |
| [Configuration Settings][Configuration Settings Property] | `($)ConfigurationSettings`, with no value | `($)CloseSession` is a variable of type [Dictionary][]&lt;[String][], [EncryptableText][]&gt; |
| [Response][Response Property] | `($)Response`, with no value | `($)Response` will be set to the type [String][] |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The regex used to match the host's terminal prompt.
| Data Type | [String][] |
| Is [Advanced][] | `true` |
| Default Editor | [Literal][] |
| Default Value | [String][] with value `(.*(~(.*[\r\n]?)\$\|>))` |
| Default Value | [String][] with value `.*[>\|\$\|#]` |

## Remarks

Expand All @@ -92,7 +92,7 @@ The following table shows some of the ways that `SshSessionDetails` can be creat

| Method | Example | Result | Editor&nbsp;Support | Notes |
|-|-|-|-|-|
| Use a `SshSessionDetails` constructor | `new SshSessionDetails(host: "localhost", port: 22, credentials: new UserCredentials(domain: "domain", username: "user", password: "password"), terminalPrompt: $@"(.*(~(.*[\r\n]?)\$\|>))")` | `{"Host": "localhost", "Port": 22, "Credentials": { "Domain": "domain", "Username": "user", "Password": "## REDACTED ## - This value has been redacted as it contains text that should be encrypted, but is not."}, "TerminalPrompt": "(.*(~(.*[\\r\\n]?)\\$\|>))" }` | Expression |
| Use a `SshSessionDetails` constructor | `new SshSessionDetails(host: "localhost", port: 22, credentials: new UserCredentials(domain: "domain", username: "user", password: "password"), terminalPrompt: $@".*[>\|\$\|#]")` | `{"Host": "localhost", "Port": 22, "Credentials": { "Domain": "domain", "Username": "user", "Password": "## REDACTED ## - This value has been redacted as it contains text that should be encrypted, but is not."}, "TerminalPrompt": ".*[>\|\\$\|#]" }` | Expression |

A `SshSessionDetails` can also be created using the Literal Editor by filling in the necessary values for the following properties:

Expand All @@ -101,13 +101,13 @@ A `SshSessionDetails` can also be created using the Literal Editor by filling in
| `Host` | `EncryptableText` | `"localhost"` | [Host][] defines the address of the server to connect to. |
| `Port` | `Int32` | `22` | [Port][] defines the port on the server to connect to. |
| `Credentials` | `ISshCredentials` | `new UserCredentials(domain: "domain", username: "user", password: "password")` | [Credentials][] defines the credentials used to authenticate the connection to the server. |
| `TerminalPrompt` | `Int32` | `(.*(~(.*[\r\n]?)\$\|>))` | [TerminalPrompt][] defines the regex used to match the host's terminal prompt. |
| `TerminalPrompt` | `Int32` | `.*[>\|\$\|#]` | [TerminalPrompt][] defines the regex used to match the host's terminal prompt. |

### Convert SshSessionDetails to Text

| Method | Example | Result | Editor&nbsp;Support | Notes |
|-|-|-|-|-|
| Use `Convert Object To Json` block | where `Object` property has a value of `{"Host": "localhost", "Port": 22, "Credentials": { "Domain": "domain", "Username": "user", "Password": "password"}, "TerminalPrompt": "(.*(~(.*[\\r\\n]?)\\$\|>))"}` | `"{\r\n \"Host\": \"localhost\",\r\n \"Port\": 22,\r\n \"Credentials\": {\r\n \"Domain\": \"domain\",\r\n \"Username\": \"username\",\r\n \"Password\": \"## REDACTED ## - This value has been redacted as it contains text that should be encrypted, but is not.\",\r\n},\r\n \"TerminalPrompt\": \"(.*(~(.*[\\\\r\\\\n]?)\\\\$\|>))\"\r\n}"` | N/A | See [Convert Object To Json][] |
| Use `Convert Object To Json` block | where `Object` property has a value of `{"Host": "localhost", "Port": 22, "Credentials": { "Domain": "domain", "Username": "user", "Password": "password"}, "TerminalPrompt": $@".*[>\|\\$\|#]"}` | `"{\r\n \"Host\": \"localhost\",\r\n \"Port\": 22,\r\n \"Credentials\": {\r\n \"Domain\": \"domain\",\r\n \"Username\": \"username\",\r\n \"Password\": \"## REDACTED ## - This value has been redacted as it contains text that should be encrypted, but is not.\",\r\n},\r\n \"TerminalPrompt\": \".*[>\|\\\\$\|#]\"\r\n}"` | N/A | See [Convert Object To Json][] |

### Property Editor Support

Expand Down

0 comments on commit c4b7c26

Please sign in to comment.