scorpiox-pwsh๐Ÿš shell

Execute PowerShell commands on remote Windows machines via the DevKit REST API. Enables cross-platform remote administration from Linux or macOS.

๐Ÿง Linux x64 ๐Ÿง Linux ARM64 ๐ŸŽ macOS ARM64 ๐ŸชŸ Windows x64

โš™๏ธ Flags & Options (7)

Flag Short Description Takes Value
--help -h Show help message and exit No
--stream -s Stream output in real-time as the command executes No
-H โ€” DevKit host address (IP or hostname of the Windows machine) Yes
-c โ€” PowerShell command or script block to execute remotely Yes
-k โ€” API key for DevKit REST API authentication Yes
-t โ€” Connection and execution timeout in seconds Yes
-w โ€” Set the working directory on the remote machine Yes

๐Ÿ’ก Usage Examples

Basic remote command
# Run a PowerShell command on a remote Windows machine
$ scorpiox-pwsh -H 192.168.1.50 -k myapikey -c "Get-Process | Select-Object -First 5"
Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName
------- ------ ----- ----- ------ -- -----------
182 13 2384 5120 0.14 1024 svchost
312 22 8740 14208 1.87 2048 explorer
95 8 1680 3584 0.03 3072 conhost
System information gathering
# Get OS version and hostname
$ scorpiox-pwsh -H win-server.local -k $DEVKIT_KEY -c "Get-ComputerInfo | Select-Object CsName, OsName, OsVersion"

# Check disk space on remote machine
$ scorpiox-pwsh -H 10.0.0.5 -k $DEVKIT_KEY -c "Get-PSDrive -PSProvider FileSystem | Format-Table Name, Used, Free -AutoSize"
Streaming long-running operations
# Stream output from a remote build process
$ scorpiox-pwsh --stream -H build-server -k $DEVKIT_KEY -c "msbuild MyProject.sln /t:Build /p:Configuration=Release"

# Watch a remote log file in real-time
$ scorpiox-pwsh -s -H 192.168.1.50 -k $DEVKIT_KEY -c "Get-Content C:\logs\app.log -Wait -Tail 20"
Working directory and timeout
# Execute in a specific directory on the remote machine
$ scorpiox-pwsh -H win-server -k $DEVKIT_KEY -w "C:\Projects\MyApp" -c "dotnet test"

# Set a 60-second timeout for a slow operation
$ scorpiox-pwsh -H 10.0.0.5 -k $DEVKIT_KEY -t 60 -c "Invoke-WebRequest -Uri https://example.com/large-file.zip -OutFile C:\temp\file.zip"
Service management
# Restart a Windows service remotely
$ scorpiox-pwsh -H prod-server -k $DEVKIT_KEY -c "Restart-Service -Name 'W3SVC' -Force; Get-Service 'W3SVC'"
Status Name DisplayName
------ ---- -----------
Running W3SVC World Wide Web Publishing Service
Script block execution
# Run a multi-line script block
$ scorpiox-pwsh -H win-server -k $DEVKIT_KEY -c "\
  \$drives = Get-PSDrive -PSProvider FileSystem;
  foreach (\$d in \$drives) {
    Write-Output \"$($d.Name): $([math]::Round($d.Free/1GB,2)) GB free\"
  }"
C: 142.38 GB free
D: 487.21 GB free
Display help
$ scorpiox-pwsh --help

๐Ÿ“ฆ Source & Build Info

Source File
scorpiox/scorpiox-pwshovertcp.c
Lines of Code
684
Dependencies
libsxutil
Platforms
linux-x64 ยท linux-arm64 ยท macos-arm64 ยท windows-x64

๐Ÿ”— Related Tools