From 9c6e2bbd4a1ed6a55500351321c0237b7fa8adcd Mon Sep 17 00:00:00 2001 From: Greg Cockburn Date: Sat, 18 Jan 2014 15:47:03 +1100 Subject: [PATCH 1/2] add a check to see if script is null --- bin/winrm-cli | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/winrm-cli b/bin/winrm-cli index 7ed689c..733a2bb 100755 --- a/bin/winrm-cli +++ b/bin/winrm-cli @@ -77,6 +77,10 @@ command :script do |c| c.action do |args, options| script = ARGV.join(" ").split(' -- ',2)[1] + if !script + $stderr.puts "no script supplied" + exit 1 + end # create a session session = EventMachine::WinRM::Session.new(:log_level => :info) opts = {:user => options.username, :password => options.password, :basic_auth_only => basic_auth?(options.username), :operation_timeout => 1800, :disable_sspi => true} From e9c7af3ace794581380359d0d92165efd45be1b2 Mon Sep 17 00:00:00 2001 From: Greg Cockburn Date: Sat, 18 Jan 2014 15:52:22 +1100 Subject: [PATCH 2/2] add some basic usage examples --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4069a40..a5f37f5 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,17 @@ Or install it yourself as: ## Usage -TODO: Write usage instructions here +### PowerShell Script + + $ winrm-cli script --username joeuser --computer win-01 --password "mypassword" -- "Get-WMIObject Win32_Volume | ft Caption, DirtyBitSet -autosize" + +### CMD + + $ winrm-cli script --username joeuser --computer win-01 --password "mypassword" -- ipconfig + +### Getting a back trace + + $ winrm-cli --trace ## Contributing