def get_shell_type():
 out = run_shell_command('echo $host.name', shell=True)[0]
 if (out.strip() == 'ConsoleHost'):
  return 'powershell'
 out = run_shell_command('echo $0', shell=True)[0]
 if (out.strip() == '$0'):
  return 'cmd'
 return 'sh'

def get_shell_type ( ) : out = run_shell_command ( 'echo $host.name' , shell = True ) [ 0 ] if ( out . strip ( ) == 'ConsoleHost' ) : return 'powershell' out = run_shell_command ( 'echo $0' , shell = True ) [ 0 ] if ( out . strip ( ) == '$0' ) : return 'cmd' return 'sh'
finds the current shell type based on the outputs of common pre-defined variables in them .