How to switch between PowerShell and Command Prompt with CLI

How to switch between PowerShell and Command prompt

To launch the Command prompt on PowerShell (PS>), do the following.

PS> cmd

To launch Windows PowerShell on Command prompt (cmd>), do the following.

cmd> powershell

For the cross-platform version of PowerShell, see below.

cmd> pwsh

Example Command Prompt -> Windows PowerShell -> Command Prompt

You can see that the ls cmdlet can be executed only on Windows PowerShell.

C:\Users\user\Desktop\test>ls
'ls' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
C:\Users\user\Desktop\test>powershell
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
PS C:\Users\user\Desktop\test> ls
 
Directory: C:\Users\user\Desktop\test
 
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2018/05/08 16:25 test
 
PS> cmd
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\user\Desktop\test>