How to run a PowerShell script?

Shahid
Shahid

Posted On: Feb 22, 2018

 

To run a script in the PowerShell, go to the directory where your script is stored on your PowerShell command. Then, run the script by typing the following command.

PS C:\script_folder> ./Script.ps1  

Here, script_folder is the path of the folder where your script is stored, and Script.ps1 is the name of your script.

PS C:\script_folder> .\Script.ps1 

Alternatively, you can use the above command to run the script.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    PowerShell Interview Questions

    What is PowerShell?

    PowerShell is a command-line tool built upon the .NET framework to help the windows system administrator. With PowerShell, you can control your system operations such as accessing data storage, regist...

    PowerShell Interview Questions

    How to check powershell version in Windows?

    Open your PowerShell command and type the following command to find the version, PS C:\> $PSVersionTable.PSVersion The major column value of the result is the version of your PowerShell....

    PowerShell Interview Questions

    How to start powershell in windows 10?

    To Start the PowerShell, go to the search option and type PowerShell. The PowerShell will be listed in the option. Click on it open the PowerShell window. Another method is to type PowerShell on your ...