4.7 C
Sunday, February 18, 2024

Run PowerShell script from Azure Cloud Shell

Must read

[et_pb_section fb_built=”1″ _builder_version=”3.29.3″][et_pb_row _builder_version=”3.29.3″][et_pb_column _builder_version=”3.29.3″ type=”4_4″][et_pb_text _builder_version=”3.29.3″]

Upload And Run PowerShell Script from Azure Cloud Shell

In this blog post, I will show you how to upload and run PowerShell scripts from Microsoft Azure Cloud Shell.

Azure Cloud Shell gives us great flexibility because we can store our scripts and run them from a cloud location.

Cloud Shell does not depend on the local machine, which is excellent for saving scripts and run them from anywhere.

In my case, I am going to upload a basic PowerShell script to Cloud Shell and show you how to run it.

Run Script from Azure Cloud Shell

Running uploaded scripts from Azure Cloud Shell can only be done from the $HOME folder.

To access the $HOME I type the following command.

cd ~

I can also use the command below:


Once in the home drive, I can run my PowerShell script using.


Upload Script

To upload a script to Cloud Shell, I will use the upload button from the Cloud Shell menu.

You can also notice that I have the option to Upload and Download files.

To upload a file, I will click on Upload and select the PS1 script from my local machine.

When the upload is completed, I will see the complete message below.

AZURE CLI and Other Scripts

This process will work with any scripting language that Azure Cloud Shell supports.


- Advertisement -spot_img

More articles


Please enter your comment!
Please enter your name here

- Advertisement -spot_img

Latest article