code: def winrm_cmd(session, command, flags, **kwargs):
      '''
      Wrapper for commands to be run against Windows boxes using WinRM.
      '''
      log.debug('Executing WinRM command: %s %s', command, flags)
      # rebuild the session to ensure we haven't timed out
      session.protocol.transport.build_session()
      r = session.run_cmd(command, flags)
      return r.status_codf winrm_cmd(session, command, flags, **kwargs):
      '''
      Wrapper for commands to be run against Windows boxes using WinRM.
      '''
      log.debug('Executing WinRM command: %s %s', command, flags)
      # rebuild the session to ensure we haven't timed out
      session.protocol.transport.build_session()
      r = session.run_cmd(command, flags)
      return r.status_code
docs: Wrapper for commands to be run against Windows boxes using WinRM.