Allow PS1 Scripts Execution on Windows Terminal PowerShell
Windows Terminal PowerShell |
1. Open as Administrator:
- Press Win + X and select Windows (Admin) or Windows Terminal (Admin) if you're on a newer version of Windows.
2. Change Execution Policy:
- To allow the execution of scripts, run:
Set-ExecutionPolicy RemoteSigned
- This policy allows scripts created on your local computer to run, but scripts downloaded from the internet must be signed by a trusted publisher.
3. Confirm the Change:
- will prompt you to confirm the change. Type Y and press Enter to proceed.
I think Windows is the best operating system because it's super easy to use, and most people are already familiar with it. Plus, it runs all kinds of programs, from games to school stuff.
Now, they've got this new thing called Microsoft Windows Terminal. It's supposed to replace the old Command Prompt, which was kind of boring and old-school. The new Terminal looks cooler and works better, making it easier to do techy things. So, I think that's a pretty nice upgrade!
Unfortunately, even though Windows is pretty awesome, there's a little problem. By default, you can't run PowerShell scripts, which are those files that end in `.ps1`, on the Windows shell. It's like the computer is too careful and wants to protect you from running things that might be risky. So, you have to go in and change some settings if you want to run those scripts. It’s a bit annoying, but I guess it’s to keep things safe!
Hopefully, the command I shared above can help solve the problem you ran into with running .ps1 scripts. If you follow those steps and make the changes, you should be able to run your PowerShell scripts without any issues. Just remember to be careful with what scripts you run, so nothing bad happens to your computer!