Last active
April 19, 2019 05:18
-
-
Save Kenya-West/7e5b1ec19c13fcf3051dce8f92ca99ae to your computer and use it in GitHub Desktop.
Automatically get wallpapers from Windows 10 Spotlight
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$folderName = "Spotlight Wallpapers"; | |
$desktopPath = "$env:USERPROFILE\Desktop\"; | |
$spotlightPath = "$env:LOCALAPPDATA\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets"; | |
if (Test-Path -Path $desktopPath$folderName) { | |
Write-Host ("No need to create $folderName in $desktopPath"); | |
} | |
else { | |
New-Item -Name $folderName -ItemType Directory -Path $desktopPath ; | |
Write-Host ("Created $folderName in $desktopPath"); | |
} | |
Get-ChildItem -Path $spotlightPath | Copy-Item -Destination $desktopPath$folderName -ErrorAction SilentlyContinue; | |
Get-ChildItem -Path $desktopPath$folderName -Exclude "*.jpg" | Rename-Item -NewName { $_.name -Replace '$','.jpg' } | |
explorer $desktopPath$folderName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment