I have a Power Shell script file (it's PS5 on Win10) that allow me to change to a specific wallpaper when I execute it. I can only do that if I have administrator access. There are ways work around like making a .bat file
powershell.exe -executionpolicy bypass -windowstyle hidden -noninteractive -nologo -file "C:\Users\name\wallp1.ps1"
But it seems that method will change execution policy permanently to unrestricted which is really unsecure What I want is to be able to execute a PS script through Task Scheduler (it must be through that not through Startup folder). I want to be able to change Wallpaper on a specific time and only Task Scheduler can do that. Unless I can do that with command or batch files.
In short: I want to run a PS script through another file without messing with current Execution Policy
Other method seems not work: how to run PowerShell Script when computer starts?
Or maybe there is a way to be able to revert back to default execution policy after the PS script has ran? It must be done automatically in one file
Using the launch command you provided does not change the execution policy permanently on the host. Tested on Win10 with PS5.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments