SimpleExec 8.0.0
See the version list below for details.
dotnet add package SimpleExec --version 8.0.0
NuGet\Install-Package SimpleExec -Version 8.0.0
<PackageReference Include="SimpleExec" Version="8.0.0" />
<PackageVersion Include="SimpleExec" Version="8.0.0" />
<PackageReference Include="SimpleExec" />
paket add SimpleExec --version 8.0.0
#r "nuget: SimpleExec, 8.0.0"
#:package SimpleExec@8.0.0
#addin nuget:?package=SimpleExec&version=8.0.0
#tool nuget:?package=SimpleExec&version=8.0.0
SimpleExec
SimpleExec is a .NET library that runs external commands. It wraps System.Diagnostics.Process to make things easier.
SimpleExec intentionally does not invoke the system shell.
By default, the command is echoed to standard error (stderr) for visibility.
Platform support: .NET Standard 2.0 and later.
Quick start
using static SimpleExec.Command;
Run("foo.exe", "arg1 arg2");
API
Run
Run("foo.exe");
Run("foo.exe", "arg1 arg2", "my-working-directory");
await RunAsync("foo.exe");
await RunAsync("foo.exe", "arg1 arg2", "my-working-directory");
Read
var output1 = Read("foo.exe");
var output2 = Read("foo.exe", "arg1 arg2", "my-working-directory");
var output3 = await ReadAsync("foo.exe");
var output4 = await ReadAsync("foo.exe", "arg1 arg2", "my-working-directory");
Other optional arguments
bool noEcho = false,
string windowsName = null,
string windowsArgs = null,
string logPrefix = null,
Action<IDictionary<string, string>> configureEnvironment = null,
bool createNoWindow = false,
Func<int, bool> handleExitCode = null,
CancellationToken cancellationToken = default,
Exceptions
If the command has a non-zero exit code, an ExitCodeException is thrown with an int ExitCode property and a message in the form of:
$"The process exited with code {ExitCode}."
This behaviour can be overridden by passing a delegate to handleExitCode which returns true when it has handled the exit code and default exit code handling should be suppressed, and returns false otherwise. For example:
Run("ROBOCOPY", "from to", handleExitCode: exitCode => exitCode < 8);
Windows
🙄
Sometimes, for whatever wonderful reasons, it's necessary to run a different command on Windows. For example, when running Yarn, some combination of mysterious factors may require that you explicitly run cmd.exe with Yarn as an argument, rather than running Yarn directly. The optional windowsNames and windowsArgs parameters may be used to specify a different command name and arguments for Windows:
Run("yarn", windowsName: "cmd", windowsArgs: "/c yarn");
<sub>Run by Gregor Cresnar from the Noun Project.</sub>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (14)
Showing the top 5 NuGet packages that depend on SimpleExec:
| Package | Downloads |
|---|---|
|
Miracatch.Shared
Shared code across Miracatch components. |
|
|
Vertiq.Testing.XUnit
A highly modular framework for writing Blazor applications with a hassle-free, vertical-sliced architecture - Easy. Flexible. Focused. |
|
|
Dex.IdentityServer4
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core |
|
|
Xenial.Beer
Beer - Delicious dotnet build tools |
|
|
ILVerifier
A simple helper library to access provider-specific types when working with IDbConnection and friends. |
GitHub repositories (41)
Showing the top 20 popular GitHub repositories that depend on SimpleExec:
| Repository | Stars |
|---|---|
|
xunit/xunit
xUnit.net is a free, open source, community-focused unit testing tool for .NET.
|
|
|
aaubry/YamlDotNet
YamlDotNet is a .NET library for YAML
|
|
|
adamhathcock/sharpcompress
SharpCompress is a fully managed C# library to deal with many compression types and formats.
|
|
|
AppMetrics/AppMetrics
App Metrics is an open-source and cross-platform .NET library used to record and report metrics within an application.
|
|
|
gothinkster/aspnetcore-realworld-example-app
ASP.NET Core backend implementation for RealWorld
|
|
|
FakeItEasy/FakeItEasy
The easy mocking library for .NET
|
|
|
ProxyKit/ProxyKit
A toolkit to create code-first HTTP reverse proxies on ASP.NET Core
|
|
|
DuendeArchive/IdentityModel
.NET standard helper library for claims-based identity, OAuth 2.0 and OpenID Connect.
|
|
|
adamralph/minver
🏷 Minimalistic versioning using Git tags.
|
|
|
machine/machine.specifications
Machine.Specifications is a Context/Specification framework for .NET that removes language noise and simplifies tests.
|
|
|
DuendeArchive/IdentityModel.OidcClient
Certified C#/NetStandard OpenID Connect Client Library for native mobile/desktop Applications (RFC 8252)
|
|
|
JasperFx/lamar
Fast Inversion of Control Tool and Successor to StructureMap
|
|
|
Particular/Workshop
SOA Done Right
|
|
|
spectresystems/snitch
A tool that help you find duplicate transitive package references.
|
|
|
SQLStreamStore/SQLStreamStore
Stream Store library targeting RDBMS based implementations for .NET
|
|
|
XamlAnimatedGif/XamlAnimatedGif
A simple library to display animated GIF images in WPF apps (.NET Framework 4.5, .NET Core 3.1, .NET 5.0)
|
|
|
config-r/config-r
Write your .NET configuration files in C#
|
|
|
JasperFx/jasper
Next generation application development framework for .Net
|
|
|
SnapXL/SnapX
SnapX is a free, open-source, cross-platform tool that lets you capture or record any area of your screen and instantly share it with a single keypress. Upload images, videos, text, and more to multiple supported destinations—all with ease. ShareX fork
|
|
|
microsoft/PowerApps-Tooling
Tooling support for PowerApps language and .msapp files
|
| Version | Downloads | Last Updated |
|---|---|---|
| 12.0.0 | 803,720 | 1/15/2024 |
| 12.0.0-rc.1 | 442 | 12/25/2023 |
| 12.0.0-beta.1 | 290 | 12/24/2023 |
| 12.0.0-alpha.1 | 2,070 | 6/9/2023 |
| 11.0.0 | 555,894 | 8/21/2022 |
| 11.0.0-rc.1 | 715 | 7/22/2022 |
| 10.0.0 | 177,515 | 3/26/2022 |
| 10.0.0-beta.2 | 21,122 | 3/20/2022 |
| 10.0.0-beta.1 | 354 | 3/19/2022 |
| 9.1.0 | 17,163 | 3/19/2022 |
| 9.1.0-rc.1 | 331 | 3/13/2022 |
| 9.1.0-alpha.1 | 347 | 3/12/2022 |
| 9.0.0 | 4,824 | 3/12/2022 |
| 9.0.0-rc.4 | 1,364 | 2/26/2022 |
| 9.0.0-rc.3 | 10,222 | 12/30/2021 |
| 9.0.0-rc.2 | 388 | 12/23/2021 |
| 9.0.0-rc.1 | 299 | 12/23/2021 |
| 9.0.0-alpha.1 | 26,537 | 8/22/2021 |
| 8.0.0 | 773,604 | 7/5/2021 |
| 8.0.0-rc.1 | 584 | 6/26/2021 |
| 8.0.0-alpha.8 | 332 | 6/20/2021 |
| 8.0.0-alpha.7 | 303 | 6/19/2021 |
| 8.0.0-alpha.6 | 331 | 6/19/2021 |
| 8.0.0-alpha.5 | 336 | 6/19/2021 |
| 8.0.0-alpha.4 | 362 | 6/19/2021 |
| 8.0.0-alpha.3 | 1,050 | 6/13/2021 |
| 8.0.0-alpha.2 | 525 | 6/12/2021 |
| 8.0.0-alpha.1 | 367 | 6/12/2021 |
| 7.0.0 | 75,497 | 3/14/2021 |
| 7.0.0-alpha.2 | 444 | 3/13/2021 |
| 7.0.0-alpha.1 | 4,566 | 12/20/2020 |
| 6.4.0 | 76,517 | 12/20/2020 |
| 6.4.0-rc.1 | 1,686 | 12/5/2020 |
| 6.3.0 | 48,420 | 10/26/2020 |
| 6.2.0 | 324,594 | 12/21/2019 |
| 6.2.0-rc.1 | 1,476 | 12/15/2019 |
| 6.1.0 | 65,938 | 10/13/2019 |
| 6.1.0-rc.1 | 1,649 | 9/8/2019 |
| 6.1.0-beta.1 | 880 | 8/27/2019 |
| 6.0.0 | 57,984 | 7/13/2019 |
| 6.0.0-rc.1 | 441 | 6/27/2019 |
| 6.0.0-beta.1 | 696 | 6/12/2019 |
| 6.0.0-alpha.1 | 475 | 6/1/2019 |
| 5.0.1 | 21,246 | 2/10/2019 |
| 5.0.1-rc.1 | 632 | 2/10/2019 |
| 5.0.0 | 390 | 2/9/2019 |
| 5.0.0-beta.1 | 977 | 2/5/2019 |
| 5.0.0-alpha.2 | 370 | 2/4/2019 |
| 5.0.0-alpha.1 | 671 | 1/3/2019 |
| 4.2.0 | 18,050 | 12/8/2018 |
| 4.1.0 | 2,369 | 12/2/2018 |
| 4.0.0 | 419 | 11/27/2018 |
| 4.0.0-rc.1 | 451 | 11/26/2018 |
| 4.0.0-beta.1 | 757 | 11/20/2018 |
| 3.0.0 | 23,617 | 9/20/2018 |
| 2.3.0 | 2,583 | 8/25/2018 |
| 2.3.0-beta.1 | 507 | 8/11/2018 |
| 2.2.0 | 2,156 | 6/26/2018 |
| 2.1.0 | 1,849 | 5/20/2018 |
| 2.0.0 | 1,889 | 11/12/2017 |
| 1.0.0 | 7,106 | 11/5/2017 |