{"id":663,"date":"2018-08-09T19:41:47","date_gmt":"2018-08-09T11:41:47","guid":{"rendered":"http:\/\/blog.nami.idv.tw\/?p=663"},"modified":"2019-07-11T17:39:51","modified_gmt":"2019-07-11T09:39:51","slug":"%e7%94%a8-powershell-%e8%87%aa%e5%8b%95%e5%82%99%e4%bb%bd-windows-10-%e7%9a%84%e7%84%a6%e9%bb%9e%e5%bd%b1%e5%83%8f","status":"publish","type":"post","link":"https:\/\/blog.nami.idv.tw\/?p=663","title":{"rendered":"\u7528 PowerShell \u81ea\u52d5\u5099\u4efd Windows 10 \u7684\u7126\u9ede\u5f71\u50cf"},"content":{"rendered":"<p>Title: Windows Spotlight auto backup script by PowerShell<\/p>\n<p>Windows 10 \u7684\u9396\u5b9a\u756b\u9762\u5982\u679c\u80cc\u666f\u9078\u7528 \"Winodws \u7126\u9ede\" \u7684\u8a71\u6703\u6bcf\u5929\u8b8a\u63db\u5f71\u50cf\uff0c\u7cfb\u7d71\u4e0b\u8f09\u7684\u9019\u4e9b\u5f71\u50cf\u4e26\u4e0d\u6703\u4e00\u76f4\u4fdd\u7559\u800c\u662f\u6703\u522a\u9664\u820a\u7684\uff0c\u56e0\u6b64\u82e5\u662f\u60f3\u8981\u5c07\u597d\u770b\u7684\u98a8\u666f\u4fdd\u7559\u4e0b\u4f86\u7684\u8a71\u5fc5\u9808\u81ea\u5df1\u5099\u4efd\uff0c\u65bc\u662f\u6211\u5c31\u5beb\u4e00\u5c0f\u6bb5\u78bc\u4f86\u81ea\u52d5\u5316\u5099\u4efd\u9019\u4e9b\u98a8\u666f\u3002<\/p>\n<p>\u628a\u4ee5\u4e0b\u7a0b\u5f0f\u78bc\u5b58\u6a94\u5f8c\u7528\u5de5\u4f5c\u6392\u7a0b\u5668\u5b89\u6392\u6bcf\u5929\u57f7\u884c\u6216\u767b\u5165\u6642\u57f7\u884c\u5373\u53ef\uff0c\u8a18\u5f97\u628a $to \u7684\u8def\u5f91\u6539\u6210\u81ea\u5df1\u7684\u5099\u4efd\u8def\u5f91\uff1a<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; auto-links: false; title: ; notranslate\" title=\"\">\n$from = &quot;$env:USERPROFILE\\AppData\\Local\\Packages\\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\\LocalState\\Assets\\&quot;\n$to = &quot;C:\\Users\\Your_Name\\Pictures\\Windows Spotlight\\&quot;\n\nGet-ChildItem -Path $from | `\nForeach-Object {\n    If ($_.length -gt 300kb) {\n        $newFilename = $to + $_.BaseName + &quot;.jpg&quot;\n        If (-not (Test-Path $newFilename)) {\n            Write-Host &quot;Copy:&quot; $_.BaseName\n            Copy-Item $_.FullName $newFilename\n        }\n    }\n}\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Title: Windows Spotlight auto backup scr &hellip; <a href=\"https:\/\/blog.nami.idv.tw\/?p=663\">\u95b1\u8b80\u5168\u6587 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-663","post","type-post","status-publish","format-standard","hentry","category-it-note"],"_links":{"self":[{"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=663"}],"version-history":[{"count":3,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/663\/revisions"}],"predecessor-version":[{"id":699,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/663\/revisions\/699"}],"wp:attachment":[{"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nami.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}