def _pshell(cmd, cwd=None):
    '''
    Execute the desired powershell command and ensure that it returns data
    in json format and load that into python
    '''
    if 'convertto-json' not in cmd.lower():
        cmd = ' '.join([cmd, '| ConvertTo-Json'])
    log.debug('PSGET: {0}'.format(cmd))
    ret = __salt__['cmd.shell'](cmd, shell='powershell', cwd=cwd)
    try:
        ret = json.loads(ret, strict=False)
    except __HOLE__:
        log.debug('Json not returned')
    return ret
dataset/ETHPy150Open saltstack/salt/salt/modules/win_psget.py/_pshell