SambaUtils 0.2.1

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

// Install SambaUtils as a Cake Tool
#tool nuget:?package=SambaUtils&version=0.2.1                

SambaUtils

A C# .NET Library to handle mounting/unmounting Samba shares on Windows.

Description

SambaUtils provides 2 methods (mount, unmount) to handle Samba shares on Windows, while reducing needed boilerplate code to handle net use.

Samba stdout/err can be enabled with SambaUtils.Options.PrintOut = true

Getting Started

Dependencies

  • Project targets .NET 6. SDK required for building.
    • We don't call anything specific, so building for .NET 4.8 or .NET 5 isn't an issue.

Building

  • Building the library from scratch just requires you to download the solution, then build this through your .NET IDE of choice
  • You can also use MSBuild from the CLI to build the file.

Installing

  • Add reference to SambaUtils.dll in your .NET Project.

  • Alternatively, download the SambaUtils package from Nuget (.NET 6).

Usage

C# Example

        public static void Main(string[] args)
        { 
            Share samba = new Share
            {
                Unc = @"\\nas\storage", // UNC path for Samba Share
                Mount = 'z', // requested mountpoint
                Credentials = new KeyValuePair<string, string>("username", "password") //samba credentials, could be read from file or pulled from another (safer) source.
            };
            
            // Enable stdout/err output for `net use`
            SambaUtils.Options.PrintOut = true;

            Samba.Mount(samba); // mount the network share with the given parameters
            Samba.Unmount(samba); // unmount the network share.
        }

Authors

lewisdoesstuff

Version History

  • 0.2
    • .NET 6 port
  • 0.1
    • Initial Release

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  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.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.

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.2.1 743 4/6/2022
0.2.0 203 4/6/2022