Skip to content

Instantly share code, notes, and snippets.

@Kenya-West
Last active April 19, 2019 05:18
Show Gist options
  • Save Kenya-West/7e5b1ec19c13fcf3051dce8f92ca99ae to your computer and use it in GitHub Desktop.
Save Kenya-West/7e5b1ec19c13fcf3051dce8f92ca99ae to your computer and use it in GitHub Desktop.
Automatically get wallpapers from Windows 10 Spotlight
$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