UNPKG

winrm-client

Version:
20 lines (17 loc) 470 B
var winrm = require('../dist/index.js'); async function performOneCommand() { try { //var result = await winrm.runCommand('mkdir D:\\winrmtest001', '10.xxx.xxx.xxx', 5985, 'username', 'password'); var result = await winrm.runCommand( 'ipconfig /all', '10.xxx.xxx.xxx', 'username', 'password', 5985 ); console.log(result); } catch (error) { console.error(`Exception Occurred: ${error}`); } } performOneCommand();