Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a check for a script and also add basic instructions to the readme #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions bin/winrm-cli
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down