Before being able to run this script without using ISE, you will need to set the execution policy.
- Run PowerShell ISE as Administrator
- Run the following command to unblock the script:
- Unblock-File -Path c:\Path\to\script.ps1
- Run the following command to allow the script to run:
- Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
- Open Task Scheduler
- Create a new local task
- Give it a name and description; APOD Wallpaper, for example.
- Set a trigger as desired, When I log in for example.
- Start a program:
- powershell.exe C:\path\to\script.ps1
- Test it out.