mirror of
https://github.com/bckelley/spotlight.git
synced 2026-08-24 03:34:12 -05:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
$files = gci $Env:LocalAppData\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets | where Length -gt 1kb
|
||||||
|
|
||||||
|
if ($files) {
|
||||||
|
$shell = New-Object -ComObject Shell.Application
|
||||||
|
$folder = "$Env:USERPROFILE\Pictures\Wallpaper\Spotlight\"
|
||||||
|
|
||||||
|
if (!(Test-Path $folder)) { mkdir $folder }
|
||||||
|
|
||||||
|
$files | % {
|
||||||
|
$_ | Copy-Item -Destination $folder\$_.jpg
|
||||||
|
Get-Item $folder\$_.jpg
|
||||||
|
} | % {
|
||||||
|
$namespace = $shell.namespace($folder)
|
||||||
|
$item = $namespace.ParseName($_.Name)
|
||||||
|
$size = $namespace.GetDetailsOf($item, 31)
|
||||||
|
if ($size -match '(\d+) x (\d+)') {
|
||||||
|
$width = [int]($Matches[1])
|
||||||
|
$height = [int]($Matches[2])
|
||||||
|
}
|
||||||
|
if (!$size -or $width -lt 1920 -or $height -lt 500) {
|
||||||
|
Remove-Item $_
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user