def exec_code_all(lang, code, cwd=None):
 powershell = lang.lower().startswith('powershell')
 if powershell:
  codefile = salt.utils.files.mkstemp(suffix='.ps1')
 else:
  codefile = salt.utils.files.mkstemp()
 with salt.utils.fopen(codefile, 'w+t', binary=False) as fp_:
  fp_.write(code)
 if powershell:
  cmd = [lang, '-File', codefile]
 else:
  cmd = [lang, codefile]
 ret = run_all(cmd, cwd=cwd, python_shell=False)
 os.remove(codefile)
 return ret

def exec_code_all ( lang , code , cwd = None ) : powershell = lang . lower ( ) . startswith ( 'powershell' ) if powershell : codefile = salt . utils . files . mkstemp ( suffix = '.ps1' ) else : codefile = salt . utils . files . mkstemp ( ) with salt . utils . fopen ( codefile , 'w+t' , binary = False ) as fp_ : fp_ . write ( code ) if powershell : cmd = [ lang , '-File' , codefile ] else : cmd = [ lang , codefile ] ret = run_all ( cmd , cwd = cwd , python_shell = False ) os . remove ( codefile ) return ret
pass in two strings .