Woof.Shell 7.0.0

Prefix Reserved
dotnet add package Woof.Shell --version 7.0.0                
NuGet\Install-Package Woof.Shell -Version 7.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Woof.Shell" Version="7.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Woof.Shell --version 7.0.0                
#r "nuget: Woof.Shell, 7.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Woof.Shell as a Cake Addin
#addin nuget:?package=Woof.Shell&version=7.0.0

// Install Woof.Shell as a Cake Tool
#tool nuget:?package=Woof.Shell&version=7.0.0                

Woof.Shell

A part of the Woof Tookit by CodeDog.

Distributed under MIT License. (c)2022 by CodeDog, All rights reserved.


About

Provides fast shell commands execution on both Linux and Windows.

  • Windows shell: cmd.exe
  • Linux shell: bash

Commands can be run synchronously or asynchronously. Asynchronous methods return ValueTask types.

Commands can throw exceptions on errors or ignore them silently.

The standard output and standard error can be either returned or ignored.

The command arguments can be either provided inline with the command or as separate strings.

In synchronous methods the current thread is blocked until the command process ends.

The asynchronous methods will return a ValueTask that will be completed when the command process completes or fails.

Usage

  • Create a ShellCommand instance like:

    var command = new ShellCommand("ls -l ~");
    

    or

    var command = new ShellDommand("dir %LOCALAPPDATA% /O:GN");
    
  • Execute like:

    var output = command.Exec();
    

    or

    var output = await command.ExecAsync();
    
  • Create and execute inline like:

    var output = await new ShellCommand("ls -l ~").ExecAsync();
    

    or

    await new ShellCommand("del *.tmp").ExecAndForgetAsync();
    

Refer to the ShellCommand class XML documentation for advanced usage.

Cross-platform use

Like this:

var output = await ShellCommand(
    OS.IsLinux ? "ls -l ~" :
    OS.IsWindows ? "dir /O:GN %LOCALAPPDATA%" :
    throw new PlatformNotSupportedException()
).ExecAsync();

Also in package

FileSystem.CopyDirectoryContent()

Just see the method XML documentation.


Disclaimer

Woof Toolkit is a work in progress in constant development, however it's carefully maintained with production code quality.

PLEASE report all issues on GitHub!

Describe how to reproduce an issue. Also feel free to suggest new features or improvements.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Woof.Shell:

Package Downloads
Woof.LinuxAdmin

Provides Linux administration tools using native libc platform invoke.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.0.0 259 8/6/2023
6.2.0 593 2/20/2022

.NET7 target.