Tools.Shell.DataFlow 1.0.0

dotnet add package Tools.Shell.DataFlow --version 1.0.0
NuGet\Install-Package Tools.Shell.DataFlow -Version 1.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="Tools.Shell.DataFlow" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Tools.Shell.DataFlow --version 1.0.0
#r "nuget: Tools.Shell.DataFlow, 1.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 Tools.Shell.DataFlow as a Cake Addin
#addin nuget:?package=Tools.Shell.DataFlow&version=1.0.0

// Install Tools.Shell.DataFlow as a Cake Tool
#tool nuget:?package=Tools.Shell.DataFlow&version=1.0.0

Tools.Shell.DataFlow

A subcomponent of the Tools.Shell module that uses DataFlow to read Shell output.

Attention:

  • 1.0.0 and later are for .NET 8.0

Usage:

void Sync()
{
    // 创建 SyncShellExecutorDataflow 实例
    var shellExecutor = new DataFlow.Sync();

    // 定义你想要执行的CMD命令
    string cmdCommand = "echo Hello from CMD";
    // 使用 SyncShellExecutorDataflow 执行CMD命令并获取输出
    string cmdOutput = shellExecutor.ExecuteCmdCommand(cmdCommand);
    Console.WriteLine("CMD Output: " + cmdOutput);

    // 定义你想要执行的PowerShell命令
    string psCommand = "Write-Output 'Hello from PowerShell'";
    // 使用 SyncShellExecutorDataflow 执行PowerShell命令并获取输出
    string psOutput = shellExecutor.ExecutePowerShellCommand(psCommand);
    Console.WriteLine("PowerShell Output: " + psOutput);
}

async void Async()
{
    // 创建 AsyncShellExecutorDataflow 实例
    var shellExecutor = new DataFlow.Async();

    // 定义你想要执行的CMD命令
    string cmdCommand = "echo Hello from CMD";
    // 使用 AsyncShellExecutorDataflow 执行CMD命令并获取输出
    string cmdOutput = await shellExecutor.ExecuteCmdCommandAsync(cmdCommand);
    Console.WriteLine("CMD Output: " + cmdOutput);

    // 定义你想要执行的PowerShell命令
    string psCommand = "Write-Output 'Hello from PowerShell'";
    // 使用 AsyncShellExecutorDataflow 执行PowerShell命令并获取输出
    string psOutput = await shellExecutor.ExecutePowerShellCommandAsync(psCommand);
    Console.WriteLine("PowerShell Output: " + psOutput);
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 122 3/11/2024