HOW TO CREATE AND RUN A SCRIPT FILE IN POWERSHELL ON WINDOWS 10

Create and Running Scripts in the Windows 7,10 Powershell ISE

Powershell Tutorial for Beginners: If you are a beginner to create and run the script file on power shell on windows 10 then we will show you how to create and run a script on power shell.

Power shell is a command tool that can run a command with the scripts directly into your computer. Power shell is also use to change the system setting directly without firewall access. It is similar to the Run command but more reliable and easier to access.

Powershell Tutorial for Beginners

Power shell runs a command in a form of a script. Script is a text file that includes number of command-lines. Power shell analyse all the commands and control the system as per the commands. The only problem is if you run a script that prevents you to gain access from running that command. Also shows an error massage if you double click on the command.

In this Windows 10 guide we will show you how to run a command without any errors on power shell.

You can create a script file using word pad or note pad, power shell ISE.

How to Create a Script File Using Wordpad or Notepad

Follow the steps to create a script file using note pad or word pad:

1. Click on start.
2. Search for notepad.
3. Open the notepad.
4. Type a new script: example

Write-Host “hello! World use tech slow”
5. Click on file.
6. Select save option.
7. Browse to any folder and type script_1.ps1.
8. Click on save button.

How to Create a Script File Using Power Shell ISE

You can also use the power shell ISE to create scripts on windows 10. Follow the steps to create a new script using power shell ISE.

1. Click on search icon.
2. Type Windows PowerShell ISE.
3. Right-click on the top result.
4. Run as an administrator.
5. Type or paste your command on the tab: example
Write-Host “hello! World use tech slow”
6. Click on file.
7. Select save option.
8. Browse to any folder and type script_1.ps1.
9. Click on save button.

Once you created script file using above steps it is ready to run on a power shell.

HOW TO RUN A CREATED SCRIPT ON POWER SHELL ON WINDOWS 10

Previously created script will show an error because power shell will always block the scripts. Follow the steps to run the script on a power shell:

1. Open start.
2. Search for Powershell.
3. Right click on the power shell and run as an administrator.
4. Type “Set-ExecutionPolicy RemoteSigned” command to run the scripts.
5. Type “A” and hit enter.
6. Now go to the script1.ps1 file location.
7. Right click on the script1.ps1.
8. Click on the security tab.
9. Copy the path side of the object name.
10. Now paste it into the power shell.
& “C:\Users\Windows10\Desktop\script1.ps1”
11. Hit enter.

That’s it you can now run any type of command using the above steps if it worked successfully.

Leave a Comment