DEV Community

Cover image for Azure Cloud Shell: Use PowerShell in Bash
Tidjani Belmansour, Ph.D.
Tidjani Belmansour, Ph.D.

Posted on

Azure Cloud Shell: Use PowerShell in Bash

A quick one today...

I quite often hear this complaint: "I hate having to switch Cloud Shell from Bash to PowerShell to use cmdlets.". Well, you don't have to!

In fact, you can invoke the PowerShell Core interpreter right from within the Bash command-line in Cloud Shell. Simply type:

pwsh

And you'll fire off the PowerShell Core interpreter.
start a powershell core session in bash

Once you're done and you want to go back to the Bash command-line, simply type:

exit

And you'll exit the PowerShell Core interpreter.
exit the powershell core session and go back to bash

Simple, isn't it? ;)

As a conclusion

Working with the command line is essential when it comes to automation. Knowing that you can combine the power of Bash and PowerShell together will help you do great things.

Let's keep in touch

You can reach me on Twitter or LinkedIn.

See you soon !

Top comments (0)