FRENDS Community Task for ExecuteProcessCommand
You can install the task via FRENDS UI Task View or you can find the NuGet package from the following NuGet feed https://www.myget.org/F/frends-community/api/v3/index.json and in Gallery view in MyGet https://www.myget.org/feed/frends-community/package/nuget/Frends.Community.ExecuteProcess
Executes a command with parameters. Old task method, which is kept to maintain backward compatibility.
| Property | Type | Description | Example |
|---|---|---|---|
| ScriptPath | string |
Path to script | cmd or %windir%\system32\cmd.exe |
| Arguments | array<string,string> |
Argument name and value | /C, echo testi >> c:\test.txt |
| WaitForResponse | bool |
Wait for process response | true |
| Timeout Seconds | int |
Timeout for process response in full seconds. | 10 |
| Property | Type | Description | Example |
|---|---|---|---|
| Result | string |
Command result when waiting fo result | External process execution was successful with output: foobar |
| Status | bool |
Status of executed command. Always true when returning a result. Returns true if command was started successfully when not waiting for a result. | 0 |
New task method to execute commands with parameters. Has better options to control execution and output.
| Property | Type | Description | Example |
|---|---|---|---|
| FileName | string |
An application or document with which to start a process. Use cmd.exe to execute command on "command line" | /bin/bash |
| Arguments | array<string,string> |
Argument name and value | -c,ls |
| Property | Type | Description | Example |
|---|---|---|---|
| TimeoutSeconds | int |
Timeout in full seconds. | 30 |
| KillProcessAfterTimeout | bool |
true if process should be killed after timeout; otherwise, false | false |
| RedirectStandardInput | bool |
true if input should be read from StandardInput; otherwise, false | false |
| ThrowExceptionOnErrorResponse | bool |
true if the task should throw exception when return code is not 0. | false |
A result object with parameters
| Property | Type | Description | Example |
|---|---|---|---|
| ExitCode | int |
0 |
|
| Output | string |
Process' STDOUT output | Operation complete. |
| StdErr | string |
Process' STDERR output | Error code: 20 |
Usage:
To fetch result use syntax:
#result.ExitCode
Task could throw TimeoutException or ApplicationException.
Clone a copy of the repo
git clone https://github.com/CommunityHiQ/Frends.Community.ExecuteProcess.git
Rebuild the project
dotnet build
Run Tests
dotnet test
Create a NuGet package
dotnet pack --configuration Release
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request so that we can review your changes
NOTE: Be sure to merge the latest from "upstream" before making a pull request!
| Version | Changes |
|---|---|
| 1.6.0 | RunProcess task (Linux compatible) added |
| 1.5.0 | Multiplatform version |
| 1.4.0 | First version |
| 2.0.0 | Targeted to .NET6 and 8 and updated System.ComponentModel.Annotations to 5.0.0. |