如何确定我是在 powershell 还是 cmd 中? [英] How to determine if I'm in powershell or cmd?

查看:39
本文介绍了如何确定我是在 powershell 还是 cmd 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在玩 Windows 上的 OpenSSH,看起来正常的 Unix 别名是失踪.当我通过 SSH 登录到 Windows 机器时,我不确定它是在启动 powershell 还是 cmd.在 Windows 上查看当前正在运行的 shell 的正确方法是什么?

I've been playing with OpenSSH on Windows and it looks like the normal Unix aliases are missing. I'm not sure whether it's starting powershell or cmd when I log in to a Windows machine via SSH. What's the correct way to see the currently running shell on Windows?

推荐答案

所有功劳归于 PetSerAl,这必须作为答案发布:

All credit goes to PetSerAl, this had to be posted as an aswer:

(dir 2>&1 *`|echo CMD);&<# rem #>echo PowerShell

Win32-OpenSSH 中,此命令也有效,并输出 CMD.

Within Win32-OpenSSH this command also works, and outputs CMD.

注意:Win32-OpenSSH 似乎有点受限,cd 在我的系统上无法识别.

NB : Win32-OpenSSH seems a bit limited, cd is not recognized on my system.

这篇关于如何确定我是在 powershell 还是 cmd 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆