Skip to content

Instantly share code, notes, and snippets.

View oddur's full-sized avatar

Oddur Magnusson oddur

View GitHub Profile
@diyan
diyan / fabric_monkey_patch.py
Created August 1, 2012 16:12
Fabric monkey patch for replacing SSH transport with WinRM
import sys
import time
import subprocess
import types
from tempfile import TemporaryFile
def remote_sh(target_host, login, password, command_text, stdout=None, stderr=None):
winrs_text = 'winrs -remote:{0} -username:{1} -password:{2} -noprofile {3}'.format(
target_host, login, password, command_text)
#print('winrs text: {0}\n'.format(winrs_text))