<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

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_code