def get_shell_type():
    '\n    Finds the current shell type based on the outputs of common pre-defined\n    variables in them. This is useful to identify which sort of escaping\n    is required for strings.\n\n    :return: The shell type. This can be either "powershell" if Windows\n             Powershell is detected, "cmd" if command prompt is been\n             detected or "sh" if it\'s neither of these.\n    '
    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. This is useful to identify which sort of escaping
is required for strings.

:return: The shell type. This can be either "powershell" if Windows
         Powershell is detected, "cmd" if command prompt is been
         detected or "sh" if it's neither of these.
def get_shell_type():
    '\n    Finds the current shell type based on the outputs of common pre-defined\n    variables in them. This is useful to identify which sort of escaping\n    is required for strings.\n\n    :return: The shell type. This can be either "powershell" if Windows\n             Powershell is detected, "cmd" if command prompt is been\n             detected or "sh" if it\'s neither of these.\n    '
    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'