VorNet.SessionManagerSharp 0.0.1-wip-4

This is a prerelease version of VorNet.SessionManagerSharp.
dotnet add package VorNet.SessionManagerSharp --version 0.0.1-wip-4
NuGet\Install-Package VorNet.SessionManagerSharp -Version 0.0.1-wip-4
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="VorNet.SessionManagerSharp" Version="0.0.1-wip-4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VorNet.SessionManagerSharp --version 0.0.1-wip-4
#r "nuget: VorNet.SessionManagerSharp, 0.0.1-wip-4"
#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 VorNet.SessionManagerSharp as a Cake Addin
#addin nuget:?package=VorNet.SessionManagerSharp&version=0.0.1-wip-4&prerelease

// Install VorNet.SessionManagerSharp as a Cake Tool
#tool nuget:?package=VorNet.SessionManagerSharp&version=0.0.1-wip-4&prerelease

SessionManagerSharp

An unofficial AWS Systems Managers' Session Manager client for C#/.NET based on https://github.com/aws/session-manager-plugin.

The primary motivation and use-case is to enable automation.

Two methods are supported:

  • Task<string> SendStdOutAsync(string commandText) sends a command over standard input and returns the response from it.
  • Task SendTextFileStreamAsync(Stream stream, string destFilename) streams a text file over standard input to a destination filename. This is experimental.

Example Usage

using Microsoft.Extensions.Configuration;
using VorNet.SessionManagerSharp;

var builder = new ConfigurationBuilder()  
                .SetBasePath(Directory.GetCurrentDirectory())
                .AddJsonFile("appsettings.json", optional: false);

IConfiguration config = builder.Build();

ISessionManagerClientFactory factory = new SessionManagerClientFactory(config);
ISessionManagerClient client = factory.Create("i-0a42f2bd61658a835");

// Run a command.
await client.SendStdOutAsync("sudo ls /home/ubuntu");
Console.WriteLine(await client.WaitForStdInAsync("$ "));

// Send a text file.
using var fileStream = new FileStream("example.txt", FileMode.Open, FileAccess.Read);
await client.SendTextFileStreamAsync(fileStream, "/home/ubuntu/example.txt");
Console.WriteLine(await client.WaitForStdInAsync("$ "));
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
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
0.0.1-wip-4 207 8/9/2023
0.0.1-wip-3 72 8/7/2023
0.0.1-wip-2 77 8/4/2023
0.0.1-wip-1 84 8/3/2023
0.0.1-test-1 81 8/2/2023