If you’ve been using PowerShell but keep seeing tutorials written for Bash, switching environments can feel confusing. In this guide, I show how I installed Windows Subsystem for Linux, opened Bash inside Visual Studio Code, and used Azure CLI to create and manage resources in Microsoft Azure.
Setting up a development environment is often one of the first steps when working with cloud platforms and command-line tools. In a previous guide, I configured my environment using Visual Studio Code and explored how to run commands through the default PowerShell terminal while interacting with Microsoft Azure using Azure CLI.
While working with variables and commands in PowerShell, I ran into several syntax-related errors. One of the most common issues was forgetting that PowerShell requires variables to begin with the $ symbol. These small syntax rules caused unexpected errors and made me realize how much command behavior can differ between shell environments.
This curiosity led me to explore another widely used shell in development and cloud environments: Bash. Many Linux systems and cloud tutorials rely on Bash, so understanding how it works is an important skill for anyone working with servers, DevOps tools, or cloud platforms.
In this guide, I’ll walk through how I switched from the default PowerShell terminal to Bash using Windows Subsystem for Linux inside Visual Studio Code. Along the way, I’ll show how to install WSL, open a Bash terminal, and run Azure CLI commands while highlighting the key differences between PowerShell and Bash.
Discovering Shell Differences
After encountering repeated syntax issues, I became curious about how different shell environments handle variables and commands. This led me to explore another shell commonly used in development environments — Bash.
Many cloud platforms and Linux-based systems commonly use Bash, so I decided to switch my terminal to Bash to explore the differences.
Switching from PowerShell to Bash
Switching between these shells helped me better understand why some commands worked in one environment but produced errors in another.
To use Bash on Windows, I first needed to install Windows Subsystem for Linux (WSL), which allows Linux tools and distributions to run directly inside Windows.
STEPS:
1. Installing Windows Subsystem for Linux
To install WSL, open PowerShell as an administrator and run wsl --install.
Understanding the WSL Installation Behavior
When running the wsl --install command for the first time, the installation process may not immediately download Ubuntu. This happens when the required Windows features needed to run Linux environments are not yet enabled on the system.
If Windows Subsystem for Linux and Virtual Machine Platform are disabled, the command will first prepare the system by enabling these features.
During this stage, the command will:
Enable the required Windows components needed to support WSL.
Display a message indicating that the changes will not take effect until the system is restarted.
At this point, Ubuntu has not yet been installed. After restarting the computer, running the wsl --install command again will continue the installation process.
Another way to install WSL
Click the Windows Start icon and:
search for and open Turn Windows features on or off
wait for the popup then, scroll down and tick Windows Subsystem for Linux and Virtual Machine Platform
select ** Ok*, then click **Restart*.

After that, you can open PowerShell and run wsl --install
The system will then:
Download the Ubuntu distribution
Install the Linux environment
Prompt you to create a UNIX username and password to complete the setup.
This will serve as your Linux environment login credentials.
Note that the password may not appear while you are typing. This is normal and is done for security reasons.
2. Opening the Bash Terminal in Visual Studio Code
After installing WSL and completing the Ubuntu setup, we can now open a Bash terminal inside Visual Studio Code.
Visual Studio Code automatically detects installed Linux distributions and allows them to be used as a terminal profile.
STEPS
Open Visual Studio Code
Click Terminal in the top menu
Select New Terminal
Click the dropdown arrow next to the plus icon in the terminal panel
The terminal will now switch from PowerShell to Bash.
In the Bash Terminal, you should see something similar to: username@DESKTOP:~$ depending on your system configuration.

If you already created folder earlier, you can run cd "Linux Servers" to switch the terminal to that directory.

To shorten the Bash prompt so it only shows the hostname and the current folder, you can modify the PS1 variable by running PS1='\h:\W$ '
The long prompt appears because Bash displays the full directory path by default. Since the folder was created inside the Windows file system, Bash shows the path beginning with /mnt/c/.
Modifying the PS1 variable allows you to shorten the prompt so it displays only the hostname and the current directory.
## PowerShell vs Bash Variable Syntax
One of the first differences I noticed between PowerShell and Bash was how variables are defined. In PowerShell, variables must begin with the $ symbol while in Bash, variables are defined without the $ symbol.
Creating a Resource Group with Azure CLI
Now that the Azure CLI is installed and authenticated, we can create a Resource Group directly from the terminal.
A Resource Group in Azure is a container that holds related resources for an application such as virtual machines, storage accounts, and databases.
STEPS
- Define your variables. You can define variables on separate lines like this:
RG="Testing-10-rg"
LOCATION="eastus"
You can also define them together using the line continuation character :
RG="Testing-10-rg" \
LOCATION="eastus"
This allows you to organize variables across multiple lines when writing longer commands.
- Write the command to create the resource group. For example, run
az group create --name $RG --location $LOCATIONWhen referencing a variable in a command, you must prefix it with the $ symbol so Bash knows to substitute the variable’s value. Also check the provisioningState to know if the resource group was created or not.
- You can also run
az group list --output tableto see the resource group on Visual Studio Code.
- Now navigate to the Azure portal, search for and select Resource group to confirm from there too.

Now you can create different Azure resource depending on your task.
Delete Resource through the Visual Studio Code
Just as you can create resources through Visual Studio Code, you can also delete them from the terminal. For example, to delete the Resource group created, run az group delete --name $RG
Azure will ask for confirmation: Are you sure you want to perform this operation? (y/n)
Enter yes or y to confirm deletion.
Navigate to the Azure portal to confirm.
Conclusion
Switching between shell environments can feel confusing at first, especially when small syntax differences cause commands to behave unexpectedly. Moving from PowerShell to Bash helped me better understand how different shells handle variables, commands, and filesystem navigation.
By installing Windows Subsystem for Linux and using it inside Visual Studio Code, I was able to run a Linux-based Bash environment directly on Windows while still managing resources in Microsoft Azure through Azure CLI.
Although the transition introduced some challenges—such as differences in variable syntax and directory paths—it also made me more comfortable working across multiple terminal environments. These skills are especially useful when working with cloud infrastructure, Linux servers, and automation tools.
Understanding how both PowerShell and Bash work gives developers and cloud engineers more flexibility when working across different systems.
vbnet
If you're also learning Azure or DevOps tools, feel free to share what confused you the most when switching between PowerShell and Bash.








Top comments (0)