OnePAM 1.0.2

dotnet add package OnePAM --version 1.0.2
                    
NuGet\Install-Package OnePAM -Version 1.0.2
                    
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="OnePAM" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OnePAM" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="OnePAM" />
                    
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 OnePAM --version 1.0.2
                    
#r "nuget: OnePAM, 1.0.2"
                    
#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 OnePAM@1.0.2
                    
#: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=OnePAM&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=OnePAM&version=1.0.2
                    
Install as a Cake Tool

OnePAM PowerShell Module

PowerShell module for secure SSH, SCP, and Database access through OnePAM.

PowerShell Gallery

Requirements

  • PowerShell 7.0 or later (cross-platform — Windows, macOS, Linux)
  • No external module dependencies

Installation

Install-Module -Name OnePAM -Scope CurrentUser

To update to the latest version:

Update-Module -Name OnePAM

Add to Profile

# Automatically load on every PowerShell session
Add-Content $PROFILE 'Import-Module OnePAM'

Authentication

OnePAM uses OAuth2 Device Code flow — the same method as the CLI client. Config and tokens are stored in ~/.onepam/ and shared with the CLI.

# Log in (opens browser for authorization)
Connect-OnePAM

# Check auth status
Get-OnePAMAuthStatus

# Log out
Disconnect-OnePAM

Configuration

# View current config
Get-OnePAMConfig

# Point to a different OnePAM instance
Set-OnePAMConfig -Key api_base -Value "https://my-onepam.example.com"

# Set default organization
Set-OnePAMConfig -Key org_uuid -Value "12345678-1234-1234-1234-123456789abc"

SSH

# Interactive SSH session
Enter-OnePAMSSH -Resource "my-server"

# SSH as a specific user
Enter-OnePAMSSH -Resource "root@my-server"

# Execute a remote command
Enter-OnePAMSSH -Resource "my-server" -Command "uname -a"

SCP / File Transfer

# Upload a file
Copy-OnePAMFile -Source "myfile.txt" -Destination "my-server:/tmp/"

# Download a file
Copy-OnePAMFile -Source "my-server:/var/log/app.log" -Destination "./"

# Recursive directory copy
Copy-OnePAMFile -Source "./config/" -Destination "my-server:/etc/app/" -Recursive

Database

Supports PostgreSQL, MySQL, MSSQL, MongoDB, and Elasticsearch.

Interactive REPL

# Start interactive SQL session
Connect-OnePAMDatabase -Resource "prod-postgres"

# Inside the REPL:
#   \dt              List tables
#   \d <table>       Describe table
#   \databases       List databases
#   \h               Help
#   \q               Quit

Programmatic Queries

# Run a query and get PowerShell objects
$users = Invoke-OnePAMQuery -Resource "prod-db" -Query "SELECT * FROM users LIMIT 10"

# Pipeline-friendly output
Invoke-OnePAMQuery -Resource "prod-db" -Query "SELECT name, email FROM users" | Format-Table

# Export to CSV
Invoke-OnePAMQuery -Resource "analytics" -Query "SELECT * FROM events" | Export-Csv events.csv

Resource Management

# List all resources
Get-OnePAMResource

# Filter by type
Get-OnePAMResource -Type ssh
Get-OnePAMResource -Type database

# Get details for a specific resource
Get-OnePAMResource -Name "prod-db"

# Create a new resource
New-OnePAMResource -Name "staging-db" -Type database -TargetHost "db.staging" -Port 5432 -AgentId "agent-uuid"

# Update a resource
Set-OnePAMResource -Id "resource-uuid" -Name "new-name" -Port 5433

# Enable / Disable
Enable-OnePAMResource -Id "resource-uuid"
Disable-OnePAMResource -Id "resource-uuid"

# Delete a resource
Remove-OnePAMResource -Id "resource-uuid" -Force

Session Management

# List active sessions
Get-OnePAMSession -Status active

# List SSH sessions
Get-OnePAMSession -Type ssh

# Terminate a session
Stop-OnePAMSession -SessionId "session-uuid"

CLI Compatibility

This module shares the same configuration directory (~/.onepam/) and token format as the OnePAM CLI (onepam). If you're already authenticated with the CLI, the PowerShell module will use the same session automatically.

CLI Command PowerShell Cmdlet
op login Connect-OnePAM
op logout Disconnect-OnePAM
op status Get-OnePAMAuthStatus
op config show Get-OnePAMConfig
op config set Set-OnePAMConfig
op ls Get-OnePAMResource
op show <resource> Get-OnePAMResource -Name
op ssh <resource> Enter-OnePAMSSH
op scp Copy-OnePAMFile
op db connect Connect-OnePAMDatabase
op sessions list Get-OnePAMSession
op sessions terminate Stop-OnePAMSession
op resources create New-OnePAMResource
op resources update Set-OnePAMResource
op resources delete Remove-OnePAMResource
op resources enable Enable-OnePAMResource
op resources disable Disable-OnePAMResource

Support

Visit onepam.com for documentation and 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.2 130 4/8/2026

Publish to both PowerShell Gallery and NuGet Gallery.