Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'concerns/passparameters'
- module Test
- def self.connect(win_ip, win_user, win_password)
- include Parseparameters
- parse(win_ip, win_user, win_password)
- arr = []
- conn [... some code ...]
- end
- module Parseparameters
- extend ActiveSupport::Concern
- include do
- url = URI.parse("http://#{win_ip}:5985/wsman")
- opts = {
- endpoint: url,
- user: win_user,
- password: win_password,
- disable_sspi: true
- }
- conn = WinRM::Connection.new(opts)
- end
- end
Add Comment
Please, Sign In to add comment