UNPKG

winrm-client

Version:
55 lines (54 loc) 2.98 kB
import * as Shell from './src/shell'; import * as Command from './src/command'; import { monitorCommandOutput } from './src/interactive'; import { InteractivePromptOutput } from './src/types'; export { Shell, Command, monitorCommandOutput }; /** * Execute a command on a remote Windows machine via WinRM * @param command - Command to execute * @param host - Target host address * @param username - Username for authentication * @param password - Password for authentication * @param port - WinRM port (typically 5985 for HTTP) * @param usePowershell - Whether to use PowerShell (default: false) * @returns Command output */ export declare function runCommand(command: string, host: string, username: string, password: string, port: number, usePowershell?: boolean): Promise<string>; /** * Execute a PowerShell command on a remote Windows machine via WinRM * @param command - PowerShell command to execute * @param host - Target host address * @param username - Username for authentication * @param password - Password for authentication * @param port - WinRM port (typically 5985 for HTTP) * @returns Command output */ export declare function runPowershell(command: string, host: string, username: string, password: string, port: number): Promise<string>; /** * Execute an interactive command that responds to prompts via WinRM * @param command - Command to execute * @param host - Target host address * @param username - Username for authentication * @param password - Password for authentication * @param port - WinRM port (typically 5985 for HTTP) * @param prompts - Array of prompt patterns and responses * @param executionTimeout - Overall command timeout in ms (default: 60000) * @param httpTimeout - HTTP request timeout in ms * @param pollInterval - Output polling interval in ms (default: 500) * @returns Command output */ export declare function runInteractiveCommand(command: string, host: string, username: string, password: string, port: number, prompts: InteractivePromptOutput[], executionTimeout?: number, httpTimeout?: number, pollInterval?: number): Promise<string>; /** * Execute an interactive PowerShell command that responds to prompts via WinRM * @param command - PowerShell command to execute * @param host - Target host address * @param username - Username for authentication * @param password - Password for authentication * @param port - WinRM port (typically 5985 for HTTP) * @param prompts - Array of prompt patterns and responses * @param executionTimeout - Overall command timeout in ms (default: 60000) * @param httpTimeout - HTTP request timeout in ms * @param pollInterval - Output polling interval in ms (default: 500) * @returns Command output */ export declare function runInteractivePowershell(command: string, host: string, username: string, password: string, port: number, prompts: InteractivePromptOutput[], executionTimeout?: number, httpTimeout?: number, pollInterval?: number): Promise<string>;