How to Create a Script in Windows

You can use Windows PowerShell to write and run scripts that help you manage computers from a command line. This minHour will show you how to create scripts using Windows PowerShell on your PC.

Steps

Open Windows PowerShell ISE as an administrator.

Here’s how you can open the app:

  • Press to open the search bar.
  • Type powershell ise into the search bar.
  • Right-click Windows PowerShell ISE in the results.
  • Click Run as administrator.
  • Most modern Windows PCs come with PowerShell installed. If you don’t have the program, you can get it with the Management Framework 5.1 package at https://www.microsoft.com/en-us/download/details.aspx?id=54616.

Click the File menu.

You’ll see this in the top left corner of the program and a menu will drop-down.

Click New on the menu.

You can also click the paper and asterisk icon to start a new script.

Click the cursor in the script pane.

When you click in the Script Pane, typing is enabled.

Write your script.

If you’re new to scripting, check out this link to learn more. You can also search the web for script ideas and examples.

  • For example, type Write-Host “Hello world”.

Click the File menu.

You’ll see this in the top left corner of the program and a menu will drop-down.

Click Save on the menu.

Your file browser will open so you can rename and save your file. It will save as a .ps1 file.

Leave a Comment