{"id":3010,"date":"2024-06-10T19:28:01","date_gmt":"2024-06-10T11:28:01","guid":{"rendered":"https:\/\/104.es\/?p=3010"},"modified":"2024-06-10T19:58:52","modified_gmt":"2024-06-10T11:58:52","slug":"windows-chocolatey-installation","status":"publish","type":"post","link":"https:\/\/104.es\/index.php\/2024\/06\/10\/windows-chocolatey-installation\/","title":{"rendered":"\u5982\u4f55\u5728Windows 10 \u5b89\u88ddChocolatey"},"content":{"rendered":"\n<p>\u6700\u8fd1\u5728\u4f7f\u7528\u4e00\u4e9bWindows\u7684\u61c9\u7528\u6642\uff0c\u6709\u6642\u5019\u6703\u770b\u5230Chocolatey\uff08\u6216\u662fchoco\uff09\u6307\u4ee4\u7684\u5b89\u88dd\u65b9\u5f0f\uff0c\u611f\u89ba\u4e0a\u597d\u50cf\u662f\u4e00\u500b\u4ec0\u9ebc\u65b0\u9bae\u7684\u73a9\u610f\u5152\uff0c\u5176\u5be6\uff0c\u5b83\u5c31\u662f\u4e00\u5957\u9069\u7528\u65bcWindows\u4f5c\u696d\u7cfb\u7d71\u7684\u8edf\u9ad4\u5957\u4ef6\u7ba1\u7406\u7a0b\u5f0f\uff0c\u5c31\u597d\u50cf\u662f\u5728MacOS\u4e0a\u7684brew\u4ee5\u53caUbuntu\u4e0a\u7684apt\u4e00\u6a23\uff0c\u5728\u5b89\u88dd\u4e00\u4e9bWindows\u5957\u4ef6\u548c\u61c9\u7528\u6642\u975e\u5e38\u65b9\u4fbf\uff0c\u4e0d\u904e\uff0c\u5b83\u4e26\u4e0d\u662f\u9810\u8a2d\u4e0a\u5c31\u53ef\u4ee5\u4f7f\u7528\u7684\uff0c\u5728\u4f7f\u7528\u9019\u500b\u5957\u4ef6\u7ba1\u7406\u7a0b\u5f0f\u4e4b\u524d\uff0c\u9084\u662f\u9700\u8981\u5148\u628a\u5b83\u5b89\u88dd\u5230\u6211\u5011\u7684Windows\u4f5c\u696d\u7cfb\u7d71\u4e4b\u4e2d\u3002\u5b89\u88dd\u7684\u6b65\u9a5f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u5148\u4ee5\u7cfb\u7d71\u7ba1\u7406\u54e1\u7684\u8eab\u4efd\u57f7\u884cPowerShell\uff0c\u7136\u5f8c\u57f7\u884c\u4ee5\u4e0b\u9019\u6bb5\u7a0b\u5f0f\u78bc\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">Set-ExecutionPolicy Bypass -Scope Process -Force;<\/code><\/pre>\n\n\n\n<p>\u57f7\u884c\u4e4b\u5f8c\u7cfb\u7d71\u6c92\u6709\u56de\u8986\u4efb\u4f55\u8a0a\u606f\uff0c\u9019\u662f\u6b63\u5e38\u7684\u60c5\u6cc1\u3002\u63a5\u8457\uff0c\u518d\u57f7\u884c\u4ee5\u4e0b\u7684\u6307\u4ee4\u8a2d\u5b9a\u4e0b\u8f09\u7684\u74b0\u5883\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;<\/code><\/pre>\n\n\n\n<p>\u8acb\u7559\u9019\u4e0a\u65b9\u662f\u4e00\u884c\u6307\u4ee4\u3002\u540c\u6a23\u7684\uff0c\u6b63\u5e38\u7684\u60c5\u6cc1\u4e0b\u4e5f\u4e0d\u6703\u6709\u4efb\u4f55\u7684\u56de\u61c9\u8a0a\u606f\u3002\u63a5\u8457\uff0c\u5c31\u53ef\u4ee5\u5229\u7528\u4ee5\u4e0b\u7684\u6307\u4ee4\u9032\u884c Chocolatey\u6307\u4ee4\u7684\u5b89\u88dd\u4e86\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https:\/\/chocolatey.org\/install.ps1'));<\/code><\/pre>\n\n\n\n<p>\u4e0a\u65b9\u4e5f\u662f\u4e00\u884c\u6307\u4ee4\uff0c\u5b89\u88dd\u6642\u6703\u4e0b\u8f09\u7a0b\u5f0f\uff0c\u7136\u5f8c\u5728\u81ea\u5df1\u7684\u96fb\u8166\u5b8c\u6210\u5b89\u88dd\u7a0b\u5e8f\uff0c\u5728\u9806\u5229\u5b8c\u6210\u4e4b\u5f8c\uff0c\u5373\u53ef\u4ee5\u5982\u4e0b\u6240\u793a\u7684\u6307\u4ee4\uff0c\u6aa2\u67e5\u5b89\u88dd\u7684\u7248\u672c\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">choco -v<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5728\u4f7f\u7528\u4e00\u4e9bWindows\u7684\u61c9\u7528\u6642\uff0c\u6709\u6642\u5019\u6703\u770b\u5230Chocolatey\uff08\u6216\u662fchoco\uff09\u6307\u4ee4\u7684\u5b89\u88dd\u65b9\u5f0f\uff0c\u611f\u89ba\u4e0a\u597d\u50cf\u662f\u4e00\u500b\u4ec0\u9ebc\u65b0\u9bae\u7684\u73a9\u610f\u5152\uff0c\u5176\u5be6\uff0c\u5b83\u5c31\u662f\u4e00\u5957\u9069\u7528\u65bcWindows\u4f5c\u696d\u7cfb\u7d71\u7684\u8edf\u9ad4\u5957\u4ef6\u7ba1\u7406\u7a0b\u5f0f\uff0c\u5c31\u597d\u50cf\u662f\u5728MacOS\u4e0a\u7684brew\u4ee5\u53caUbuntu\u4e0a\u7684apt\u4e00\u6a23\uff0c\u5728\u5b89\u88dd\u4e00\u4e9bWindows\u5957\u4ef6\u548c\u61c9\u7528\u6642\u975e\u5e38\u65b9\u4fbf\uff0c\u4e0d\u904e\uff0c\u5b83\u4e26\u4e0d\u662f\u9810\u8a2d\u4e0a\u5c31\u53ef\u4ee5\u4f7f\u7528\u7684\uff0c\u5728\u4f7f\u7528\u9019\u500b\u5957\u4ef6\u7ba1\u7406\u7a0b\u5f0f\u4e4b\u524d\uff0c\u9084\u662f\u9700\u8981\u5148\u628a\u5b83\u5b89\u88dd\u5230\u6211\u5011\u7684Windows\u4f5c\u696d\u7cfb\u7d71\u4e4b\u4e2d\u3002<\/p>\n","protected":false},"author":1,"featured_media":3012,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[245],"tags":[],"class_list":["post-3010","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-windows-10-11"],"jetpack_featured_media_url":"https:\/\/104.es\/wp-content\/uploads\/2024\/06\/yujvhiyzcgq.jpg","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts\/3010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/comments?post=3010"}],"version-history":[{"count":1,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts\/3010\/revisions"}],"predecessor-version":[{"id":3011,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts\/3010\/revisions\/3011"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/media\/3012"}],"wp:attachment":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/media?parent=3010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/categories?post=3010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/tags?post=3010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}