Ipercube.NUT.Ups.Query 1.0.1

dotnet add package Ipercube.NUT.Ups.Query --version 1.0.1
                    
NuGet\Install-Package Ipercube.NUT.Ups.Query -Version 1.0.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="Ipercube.NUT.Ups.Query" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ipercube.NUT.Ups.Query" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Ipercube.NUT.Ups.Query" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ipercube.NUT.Ups.Query --version 1.0.1
                    
#r "nuget: Ipercube.NUT.Ups.Query, 1.0.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.
#:package Ipercube.NUT.Ups.Query@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ipercube.NUT.Ups.Query&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Ipercube.NUT.Ups.Query&version=1.0.1
                    
Install as a Cake Tool

Ipercube.NUT.Ups.Query

This package provides the external command-line tool upsc.exe and all required native libraries used to query UPS devices via Network UPS Tools (NUT).

The executable upsc is included as-is from the NUT project and is fully portable. It does not depend on any specific .NET Framework or .NET runtime.

📦 Purpose

This package is designed to simplify UPS status queries from .NET applications by automatically deploying the following files into the output directory:

  • upsc.exe
  • libusbclient-7.dll
  • libwinpthread-1.dll
  • libystre-0.dll
  • libtre-5.dll

Your application can then execute upsc.exe using standard .NET Process APIs.

🛠 Usage

Once the package is referenced, the upsc tool is automatically copied to:

bin\Debug\netX.Y\upsc.exe

Example usage in VB.NET:

Imports System.Diagnostics

Public Class NutUpsQuery

    Public Function Query(queryString As String) As String
	
        ' queryString examples:
		' return the battery.charge value: "ups@localhost battery.charge"
		' return all availble values: "ups@localhost"

        Dim psi As New ProcessStartInfo()
        psi.FileName = "upsc.exe"
        psi.Arguments = queryString
        psi.RedirectStandardOutput = True
        psi.UseShellExecute = False
        psi.CreateNoWindow = True

        Using p As Process = Process.Start(psi)
            Dim output As String = p.StandardOutput.ReadToEnd()
            p.WaitForExit()
            Return output
        End Using

    End Function

End Class

📁 Included Files

All files are installed under a private nut folder inside the project and copied to the output folder at build time:

tools/nut/upsc.exe
tools/nut/libusbclient-7.dll
tools/nut/libwinpthread-1.dll
tools/nut/libystre-0.dll
tools/nut/libtre-5.dll

🧩 Compatible With

  • Any .NET Framework version
  • Any .NET Core / .NET runtime version
  • WinForms, WPF, Service apps, Console apps

The package contains native tools only, with no dependencies on .NET assemblies.

👤 Author

Ipercube
https://github.com/ipercube


⚠️ This package includes only the upsc query tool.
It does not provide a full NUT client implementation or socket protocol support.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has 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
1.0.1 199 11/26/2025