#NEWLINE# def has_powershell( ) : #NEWLINE# #INDENT# if ( platform . system ( ) != 'Windows' ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# cmd = [ 'powershell' , '-Command' , 'echo test' ] #NEWLINE# with open ( os . path . devnull , 'wb' ) as devnull : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# subprocess . check_call ( cmd , stdout = cmd , stderr = devnull ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# return True