Skip to content
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