Free tools Windows power users keep installed
One-click scans. No signup required.
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
A PowerShell script is a plain-text file containing one or more PowerShell commands, saved with the .ps1 extension. Create it in Visual Studio Code, Notepad, or another text editor, then run it from an open PowerShell window by specifying its path, such as .hello.ps1. On Windows, execution policy can prevent a script from starting, so check the effective policy before changing it. The policy is a safety feature rather than a security boundary, and it is not enforced by PowerShell on non-Windows platforms.
The most reliable beginner workflow is to create the file, launch PowerShell, change to the file’s directory, run it from the prompt, and troubleshoot policy and path errors separately. Running from an open prompt keeps output and error messages visible, unlike File Explorer’s “Run with PowerShell” shortcut.
As an Amazon Associate I earn from qualifying purchases.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteWhat is a PowerShell script file?
A PowerShell script is a plain-text file that contains one or more PowerShell commands. Its filename must end in .ps1. Unlike a compiled application, it does not require a special build step: PowerShell reads the commands when you invoke the file.
The extension matters because PowerShell uses it to identify a script. A file that appears to be hello.ps1 but is actually named hello.ps1.txt is a text document, not the script you intended to run. When saving from a basic editor, verify the complete filename rather than relying only on the name shown in the editor window. If your editor has a file-type choice, plain text is the appropriate format; the important requirement is that the saved file really ends in .ps1.
Popular on Amazon
- Spacious Design: Measuring 21.1" wide and 14.1" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
- Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy ergonomic support with the integrated cushioned wrist rest.
- Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
- Durable Surface: Work with confidence on our lap desk's solid surface, featuring a sleek black carbon color, ensuring optimal air circulation to prevent your laptop from overheating.
- On-the-Go Convenience: With an integrated handle and lightweight design (2.8 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
A script can contain one command or a sequence of commands. Starting with one visible output command is useful because it lets you test the file, the path, and the PowerShell host independently before adding more logic.
What do I need before creating a script?
You need a PowerShell installation and a text editor. Microsoft identifies Visual Studio Code and ordinary editors such as Notepad as valid ways to create a script. Choose the editor based on how much assistance you want while writing:
| Authoring option | When it fits | What you do |
|---|---|---|
| Visual Studio Code | You want a dedicated coding editor for longer files | Create or open a text file, enter PowerShell commands, and save it with a .ps1 extension |
| Notepad or another basic text editor | You want the smallest possible setup for a short script | Enter plain text and use the full .ps1 filename when saving |
Windows includes Windows PowerShell 5.1, launched with powershell.exe, while the newer cross-platform product is PowerShell 7, launched with pwsh.exe. They are separate products. Their execution-policy settings are stored separately, so configuring one does not automatically configure the other. If you switch between the two, always check the policy in the host in which you intend to run the file.
PowerShell ISE is another authoring option documented for Windows PowerShell. It is not required for this workflow; a regular editor is easier to carry across Windows PowerShell 5.1, PowerShell 7, and non-Windows systems.
How do I create a .ps1 file?
- Open Visual Studio Code, Notepad, or another text editor.
- Enter one or more PowerShell commands. For a first file, use this simple example:
Write-Output 'Hello, world!' - Save the file as
hello.ps1. Confirm that the filename ends in.ps1, not.txt. - Remember the folder in which you saved the file. You will need that location when opening PowerShell.
The example writes one line to the PowerShell session when the script runs. It is intentionally small: a minimal script makes it easier to distinguish a problem in the command from a problem with the filename, path, or execution policy. Once this test works, you can replace the command or add more commands while retaining the same save-and-run process.
When saving in a basic editor, look at the complete name after saving. Some editors hide known extensions or append a text extension automatically. If PowerShell cannot find the file, check the actual name in the folder rather than assuming the visible editor title is the exact filename.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Can I create a script in Windows PowerShell ISE?
Yes. Microsoft documents creating and saving .ps1 files in the Script Pane of Windows PowerShell ISE. ISE is specifically associated with Windows PowerShell, so Visual Studio Code or another text editor is the more general choice when you work across Windows PowerShell 5.1 and PowerShell 7.
How do I run a PowerShell script from an open prompt?
Running from an open PowerShell window is the best default because you can see output, errors, prompts, and the exact command that was entered.
Also popular on Amazon
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
- Open PowerShell. On a Windows system, you can open Windows PowerShell or PowerShell 7, depending on which product you intend to use.
- Move to the directory containing the file. Use your normal directory-change command, then confirm that you are in the folder where
hello.ps1was saved. - Invoke the file by its relative path:
.hello.ps1./hello.ps1is also used as a relative path form. The backslash form,.hello.ps1, is the familiar Windows spelling. - Read the result in the same window. The example script prints
Hello, world!.
PowerShell does not normally execute a script merely because its name is typed at the prompt. Including the path, such as .hello.ps1, tells PowerShell to run the file from the current directory rather than search for a command with that name. The leading dot and slash are therefore part of the invocation, not decoration.
If you open a different PowerShell product than the one you planned to use, the script file itself is still plain text, but the host’s policy and available commands may differ. When diagnosing a failure, note whether the window is Windows PowerShell 5.1 or PowerShell 7 before changing settings.
What if the script is in another folder?
Change to that folder before invoking the script, or invoke it using a path to the file. The essential checks are that the path points to the correct directory and that the complete filename ends in .ps1. If PowerShell reports that the command cannot be found, treat that as a path or filename problem before changing execution policy.
A path problem and a policy problem produce different troubleshooting paths. First establish that PowerShell can locate the file. Only after the file is found does it make sense to inspect whether Windows is refusing to execute it.
What should I do when PowerShell says script execution is disabled?
On Windows, execution policy can block a script even when the file and command are correct. First inspect the policy rather than immediately selecting a broad override.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute- Check the effective policy with:
Get-ExecutionPolicy - Check every policy scope with:
Get-ExecutionPolicy -List - Look for policy values supplied by Group Policy. Group Policy has higher precedence than settings made in ordinary PowerShell scopes.
- If you control the computer and the policy allows a user-level change, use the documented current-user setting:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser - Try the script again from the open PowerShell prompt.
RemoteSigned treats scripts obtained from the internet differently from scripts written locally. It is not the same as turning off all checks, and a routine beginner fix should not be to use an unrestricted policy. The appropriate setting depends on the computer’s ownership and applicable organizational rules; do not change a managed machine’s policy merely to make one file run.
The effective value is the value PowerShell is actually applying in the current host. The list command is important because a single summary value does not show which scope supplied it. Reviewing all scopes also prevents you from repeatedly changing a lower-precedence setting that cannot win over an organization-controlled value.
Also popular on Amazon
- Note: Not suitable for MacBooks released after 2023 or devices with a protruding front camera; Not applicable to full-screen or notch-style tempered glass screen protectors; Do not use on the rear camera of the phone.
- 💻 Why Do You Need a Webcam Cover Slide? — Safeguard your privacy by covering your webcam with our reliable webcam cover when not in use. Don't let anyone secretly watch you. Stay protected!
- ✅ Thin & Stylish — Enhance your laptop's functionality and aesthetics with our 0.027" ultra-thin webcam covers. Seamlessly close your laptop while adding a touch of sophistication.
- ✅ Fits Most Devices — Compatible with laptops, phones, tablets, desktops! Keep your privacy intact on Ap/ple, Mac/Book, iPh/one, iP/ad, H/P, L/novo, De/ll, Ac/er, As/us, Sa/msung devices.
- ✅ 365 Days Protection — Our upgraded 3.0 adhesive ensures a strong hold that won't damage your equipment. Experience reliable, long-term privacy protection day in and day out.
Why can Set-ExecutionPolicy succeed without changing the result?
A successful Set-ExecutionPolicy command does not guarantee that the effective policy changed. A value enforced through Group Policy can override local PowerShell settings. The Get-ExecutionPolicy -List output shows the individual scopes and helps identify whether an organizational setting is controlling the machine.
If Group Policy supplies the controlling value, a local command may complete without producing the behavior you expected. In that situation, follow the organization’s rules or ask the administrator whether script execution is permitted; do not keep escalating local changes.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Which policy scopes require elevation?
A CurrentUser setting applies only to the signed-in user. A LocalMachine setting affects all users and requires an elevated PowerShell session. Changing the machine-wide scope is therefore a different administrative decision from configuring the current user. A user who does not administer the computer should not attempt to alter the machine-wide setting simply to bypass an error.
Is execution policy a security boundary?
No. Microsoft describes execution policy as defense in depth, not a security boundary. It is intended to reduce unintended script execution, but it should not be described as malware protection.
Read and understand a script before running it, especially when it came from another person or was downloaded from the internet. The policy setting changes how PowerShell handles execution; it does not make an unknown script trustworthy. A script that is allowed to run can still perform actions you did not expect, so inspect its commands and source separately from the policy discussion.
How does File Explorer’s “Run with PowerShell” option work?
In File Explorer, the “Run with PowerShell” option starts a new PowerShell session, runs the file, and closes the session when the script exits. It remains subject to execution policy.
Recommended Free Tools
That shortcut is intended for simple scripts that do not need parameters, do not need to return output for someone to read in the console, and do not prompt for input. It can be convenient for a finished, non-interactive task, but it is a poor way to learn or diagnose a script because the window can disappear before you inspect the output.
| Running method | Best use | Important limitation |
|---|---|---|
| Open PowerShell prompt | Learning, troubleshooting, viewing output and errors, responding to prompts, or supplying parameters | You must open PowerShell and move to the script’s directory |
| File Explorer: “Run with PowerShell” | A simple script that can run without interaction | A new session closes when the script exits; execution policy still applies |
For a first test, choose the open prompt even if Explorer appears faster. Seeing the command’s output confirms that the file ran, while a disappearing Explorer window leaves you unsure whether the script completed, failed, or waited for input.
Also popular on Amazon
- Anti-Slip Surface - Transform your laptop into a mobile workstation with the AboveTEK portable laptop lap desk. The anti-slip surface provides a strong grip for laptops up to 15.6 inches(Diagonal), while the double rubber strip on the bottom ensures a stable display or typing experience on your lap, couch, or bed.
- Retractable Mouse Pad - Retractable laptop mouse pad extends on both directions for the left/right handed with elevation along the edges for stopping mouse from falling off. The size of laptop tray is 14" X 9.7" and the size of mouse pad is 7.4" X 6.1".
- Effective Heat Shield - The effective heat shield made of sturdy and thick material protects your laptop from overheating. Prioritizes your comfort and safety, an ideal lap pad or board for working anywhere.
- EASY to Carry and Store - With an ergonomic and simplistic design, the lap desk is portable to store in a backpack. Only 15" in size, 2.2 lb of weight and with slim 0.6 inch thickness, it is ready to be easily carried around.
- Widely Applicable - The smooth platform accommodates laptops and tablets up to 15.6 inches(Diagonal), making it a versatile accessory and one of the best gifts for mom, dad, students and professionals. Perfect for use as a laptop bed tray or tablet holder anywhere at home, library, or park.
What is different between Windows PowerShell 5.1 and PowerShell 7?
Windows PowerShell 5.1 and PowerShell 7 are distinct products with different launch commands: powershell.exe and pwsh.exe, respectively. A script saved as plain text can be opened from either host, but do not assume that a policy change made in one host configures the other.
If a script runs in one product but is blocked in the other, launch the product that failed and run Get-ExecutionPolicy followed by Get-ExecutionPolicy -List there. Check the policy scopes in that host and also verify that you are using the intended executable. This distinction is especially important when a machine has both products installed: the same .ps1 file can encounter different effective policy settings because the settings are stored separately.
Does execution policy apply on macOS or Linux?
Microsoft states that execution-policy enforcement applies on Windows and does not apply to PowerShell on non-Windows platforms. You can still create and invoke .ps1 files with PowerShell on those platforms, but a Windows execution-policy change is not the explanation for a non-Windows result.
On a non-Windows system, focus first on the path, the selected PowerShell installation, and errors from the command itself. Do not expect a Windows policy setting to control that session. If the same script behaves differently across systems, identify which host is running it and separate host-specific behavior from file and path mistakes.
How do I separate a path error from a policy error?
Use this order so that you do not change a security-related setting to solve a spelling mistake:
- Check the exact filename and make sure it ends in
.ps1. - Check that PowerShell is in the directory where the file was saved.
- Invoke the file with an explicit relative path such as
.hello.ps1. - If the file is found but PowerShell reports that execution is disabled, run
Get-ExecutionPolicy. - Run
Get-ExecutionPolicy -Listto identify the controlling scope, including possible Group Policy values. - Only when you control the computer and the policy permits it, consider the documented
RemoteSignedsetting forCurrentUser.
| What you observe | Most useful next check | Likely response |
|---|---|---|
| The command is not recognized or the file cannot be found | Verify the directory, spelling, and complete .ps1 extension |
Correct the path or filename, then invoke it with .name.ps1 |
| The file is found but execution is disabled | Run Get-ExecutionPolicy and Get-ExecutionPolicy -List |
Follow the applicable policy; if permitted, use the current-user RemoteSigned setting |
| A local setting appears to change but the effective value does not | Inspect the policy scopes for Group Policy entries | Recognize that Group Policy can override local settings and consult the administrator if necessary |
| Explorer opens a window that disappears | Run the script from an already-open PowerShell prompt | Use the prompt when you need to read output, see errors, enter input, or pass parameters |
Do not combine several fixes at once. Correct the filename or directory first, then inspect policy only if the file is located and the error explicitly concerns execution. This order gives you a clear explanation for the eventual fix and avoids weakening a setting unnecessarily.
What is the safest beginner workflow?
For a first script, keep the process deliberate:
- Use a plain-text editor and save with the exact
.ps1extension. - Start with a small command whose output is obvious.
- Remember the save folder and open the PowerShell product you intend to use.
- Move to the script’s directory and run it from an open PowerShell prompt rather than Explorer.
- Use the explicit relative path
.script-name.ps1or./script-name.ps1. - Inspect execution policy only when PowerShell reports a policy problem.
- Review all scopes with
Get-ExecutionPolicy -Listbefore changing anything. - Prefer a scoped
CurrentUserchange withRemoteSignedwhen it is allowed and appropriate. - Remember that Group Policy can override a local setting.
- Do not treat execution policy as malware protection; review scripts before running them.
This workflow keeps the three main failure sources separate: the file itself, the path used to invoke it, and the Windows policy controlling script execution. It also works as a repeatable pattern: create or edit the plain-text file, save it, open the intended host, invoke it by path, and use the resulting output or error to choose the next check.
Frequently Asked Questions
Can Windows PowerShell ISE save a PowerShell script?
Yes. Its Script Pane can create and save files with the .ps1 extension. Microsoft’s ISE documentation is specifically for Windows PowerShell ISE, so choose a general text editor when you need one authoring workflow across different PowerShell products or operating systems.
Also popular on Amazon
- Spacious Design: Measuring 21.1" wide and 12" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
- Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy laptop support with the integrated device ledge.
- Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
- Durable Surface: Work with confidence on our lap desk's solid surface, featuring a blush pink color, ensuring optimal air circulation to prevent your laptop from overheating.
- On-the-Go Convenience: With an integrated handle and lightweight design (2.14 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
Does changing the CurrentUser execution policy require administrator access?
The CurrentUser scope is limited to the signed-in user, unlike LocalMachine, which changes behavior for everyone and requires an elevated session. An organization’s Group Policy can still control the effective result regardless of which local scope you select.
Why does a company computer ignore my execution-policy change?
The machine may receive a policy through Group Policy, whose settings take precedence over values configured in PowerShell. Use Get-ExecutionPolicy -List to see the controlling scopes, then ask the administrator whether scripts are permitted.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Will a Windows execution-policy setting protect a script on Linux or macOS?
No. Microsoft says execution-policy enforcement does not apply to PowerShell on non-Windows platforms. On those systems, investigate the script path, the selected PowerShell installation, and the command’s own errors instead.
Why does PowerShell say my script is not recognized?
First verify the complete filename, including the .ps1 extension, and confirm that the prompt is in the folder where the file was saved. Invoke it with an explicit relative path such as .hello.ps1. A command-not-found message is ordinarily a path or filename issue, not a reason to change execution policy.
Should I use File Explorer or an open PowerShell prompt?
Use an open prompt for learning, troubleshooting, visible output and errors, input, or parameters. File Explorer’s “Run with PowerShell” starts a new session and closes it when the script exits, so it is better suited to simple, non-interactive scripts.
Why does a script run in PowerShell 7 but not Windows PowerShell 5.1?
The products are separate and use different launch commands, pwsh.exe and powershell.exe. Their execution-policy settings are stored separately. Run the policy checks in the host that fails and verify that you launched the intended product.
The Bottom Line
Create a plain-text file ending in .ps1, save it from a text editor, and invoke it from the intended PowerShell host with an explicit path such as .hello.ps1. On Windows, inspect Get-ExecutionPolicy -List before making a scoped CurrentUser change, remember that Group Policy can override it, and treat execution policy as defense in depth rather than malware protection.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

