Guest User

Untitled

a guest
Apr 6th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. require 'concerns/passparameters'
  2.  
  3. module Test
  4. def self.connect(win_ip, win_user, win_password)
  5. include Parseparameters
  6. parse(win_ip, win_user, win_password)
  7.  
  8. arr = []
  9. conn [... some code ...]
  10. end
  11.  
  12. module Parseparameters
  13. extend ActiveSupport::Concern
  14.  
  15. include do
  16. url = URI.parse("http://#{win_ip}:5985/wsman")
  17. opts = {
  18. endpoint: url,
  19. user: win_user,
  20. password: win_password,
  21. disable_sspi: true
  22. }
  23. conn = WinRM::Connection.new(opts)
  24. end
  25. end
Add Comment
Please, Sign In to add comment