Scrapes all the great Windows Spotlight images used as lock screen images.
The images will be saved to a folder on your desktop named LockScreenPics.
In order to use this script, you'll need to adjust your execution policy. By default, the execution policy is set to Restricted, which means that PowerShell can only be used in interactive mode (i.e. no scripts).
To run this script, you'll need to set your execution policy to Unrestricted. If that's a little too much, you can set it to AllSigned. However, you'll need to sign the script for it to be allowed. I'll get some instructions on that up sometime.
You can set the execution policy via:
- Click the Start button
- Type in PowerShell
- Right-click on Windows PowerShell and click on Run as administrator
- Run:
Set-ExecutionPolicy Unrestricted
- Answer Y
powershell C:\Path\To\Win10LockScreenScraper.ps1
The following command will schedule the script to run daily at 1 PM:
schtasks ^
/Create ^
/RU %YOUR_USERNAME% ^
/RP "*" ^
/SC DAILY ^
/TN Win10LockScreenScraper ^
/TR "PowerShell C:\Path\To\Win10LockScreenScraper.ps1" ^
/ST 13:00
Note: The argument for /RP
"*" means that you'll be prompted for your password before the task is scheduled. This keeps you from having it in your cmd history.
Note: If you're using a Microsoft account to log in, your username will be your account's email address.
To make sure the task was successfully scheduled, you can run the task via:
schtasks /Run /TN Win10LockScreenScraper
schtasks /Delete /TN Win10LockScreenScraper
-
I've noticed that certain lock screen images contain metadata about the images (name, etc). We can base the filename off of that.
-
The destination directory is currently hardcoded. We should allow the user to configure that via an environment variable.
-
Instructions on self-signing the script, so we don't have to use the Unrestricted execution policy.
Why not? It's already available on Windows 10. No need to install any other interpreters, runtimes, etc. Plus, I wanted to play around with it :)