Skip to main content

Powershell

@tagur/powershellv2026.10.22.1· MIT· 4d agoBEHAVIORSACCEPTED WARNINGS
01README

Remote PowerShell (WinRM) for swamp.

invoke runs any script block on a remote Windows computer with Invoke-Command, optionally inside a named session configuration, and stores the output (formatted text plus the objects as JSON) as a versioned result resource.

Scripts are templates. Each {{name}} placeholder is filled from the variables map and inserted as a single-quoted PowerShell literal, so a value can hold any text without changing the command around it.

PowerShell runs locally through a configurable executable: pwsh by default, or powershell.exe on Windows. Credentials come from a vault and reach PowerShell over stdin, never on the command line; the password is never stored in results.

On Linux (including WSL) and macOS, pwsh also needs the PSWSMan WSMan client, Kerberos/NTLM GSSAPI support and domain DNS. The README walks through the full setup and how to verify it.

Quick Start

swamp extension pull @tagur/powershell
swamp vault create local_encryption powershell
printf '%s' 'EXAMPLE\admin' | swamp vault put powershell USERNAME
read -s P && printf '%s' "$P" | swamp vault put powershell PASSWORD

swamp model create @tagur/powershell ps
# globalArguments:
#   executable: pwsh
#   authentication: Negotiate
#   username: ${{ vault.get("powershell", "USERNAME") }}
#   password: ${{ vault.get("powershell", "PASSWORD") }}

swamp model @tagur/powershell method run invoke ps \
  --input computerName=server01.example.com \
  --input 'script=Get-Service -Name {{svc}}' \
  --input 'variables={"svc":"WinRM"}'
02Behaviors1
@tagur/powershellv2026.09.29.1powershell.ts

Global Arguments

ArgumentTypeDescription
executable?stringLocal PowerShell executable that runs Invoke-Command: pwsh, or
username?stringUser for -Credential, e.g. DOMAIN\\user or user@domain. Omit to use
password?stringPassword for username. Reference a vault:
authentication?enumInvoke-Command -Authentication mechanism
useSSL?booleanConnect over HTTPS (WinRM port 5986)
port?numberWinRM port override
timeoutSeconds?numberKill the local PowerShell process after this many seconds
fn invoke(computerName: string, configurationName?: string, script: string, variables?: record, name?: string)
Run a templated script block on a remote computer with Invoke-Command
ArgumentTypeDescription
computerNamestringRemote computer passed to -ComputerName
configurationName?stringSession configuration passed to -ConfigurationName
scriptstringScript block body. {{name}} placeholders are replaced with quoted
variables?recordValues for the {{name}} placeholders in script
name?stringData instance name for the result. Defaults to a slug of

Resources

result(infinite)— Output of an Invoke-Command run
03Previous Versions2
2026.10.15.1MIT(was none)
2026.09.29.1
04Stats
A
100 / 100
Downloads
35
Archive size
11.3 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned

06Platforms
07Labels