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

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