Recently, I somehow screwed up Execution Policy while I was trying to follow the instructions in a PS tutorial for newbies about how to set up PS profiles.
I assume I made some stupid errors. But I don’t know what I did.
Windows now gives a “Security Warning” whenever I try to run a PS script from the command line (e.g., in a .cmd file) in Win10, and even whenever I open a PS command window.
The settings in my PS profile don’t work, and that is a problem.
I tried with no success to unblock one script by opening a PS Window as administrator and running the following code:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser -force
Unblock-File <Script_Full_path.ps1>
But the worst problem is the Security Warnings that prevent some startup batch file commands from running.
I’m only in Chap. 3.of “Learn_PowerShell_in_a_Month_of_Lunches_4th Ed.”
I have spent several days trying with no success to solve the security problem.
To save you time, I made a PDF file containing images that shows what I did while trying various solutions I found on this forum, StackOverflow and elsewhere.
I posted the PDF at the following URL: https://tinyurl.com/4feczrsa
I bet I created a setting somewhere that is overriding everything, but I don’t know how to track it down.
I’d be ecstatic if there were some way to restore security and PS to its original status. I did find a method (which I’ve forgotten) to reset PS to its original status, but that didn’t work. The method (whatever it was) didn’t address the security issue at all.
Any suggestions would be very much appreciated.
Marc