Chose location where to place the script
- Create a folder where to place the script, eg: C:\User\Peter\APOD\
- Place the powershell script into newly created folder^^
- Edit the script file on line 8 and 11 to replace with the correct path to script file location; Replace "<UserAccount>" with your real account name.
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.