This article was co-authored by wikiHow staff writer, Darlene Antonelli, MA. Darlene Antonelli is a Technology Writer and Editor for wikiHow. Darlene has experience teaching college courses, writing technology-related articles, and working hands-on in the technology field. She earned an MA in Writing from Rowan University in 2012 and wrote her thesis on online communities and the personalities curated in such communities.
This article has been viewed 9,602 times.
Learn more...
You can use Windows PowerShell to write and run scripts that help you manage computers from a command line. This wikiHow will show you how to create scripts using Windows PowerShell on your PC.
Steps
-
1Open Windows PowerShell ISE as an administrator. Here's how you can open the app:
- Press ⊞ Win+S 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.
-
2Click the File menu. You'll see this in the top left corner of the program and a menu will drop-down.Advertisement
-
3Click New on the menu. You can also click the paper and asterisk icon to start a new script.
-
4Click the cursor in the script pane. When you click in the Script Pane, typing is enabled.[1]
-
5Write 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".
-
6Click the File menu. You'll see this in the top left corner of the program and a menu will drop-down.
-
7Click Save on the menu. Your file browser will open so you can rename and save your file. It will save as a .ps1 file.[2]
References
About This Article
1. Open PowerShell and make sure you choose "Run as administrator."
2. Click the File tab.
3. Click New.
4. Click the cursor in the script pane.
5. Write your script.
6. Click the File tab.
7. Click Save.