{"id":8038,"date":"2025-02-01T06:12:51","date_gmt":"2025-02-01T06:12:51","guid":{"rendered":"https:\/\/howtogeek.blog\/zh\/?p=8038"},"modified":"2025-02-01T06:12:51","modified_gmt":"2025-02-01T06:12:51","slug":"updating-powershell-on-windows-comprehensive-guide-to-all-methods","status":"publish","type":"post","link":"https:\/\/howtogeek.blog\/zh\/updating-powershell-on-windows-comprehensive-guide-to-all-methods\/","title":{"rendered":"\u5728 Windows \u4e0a\u66f4\u65b0 PowerShell\uff1a\u6240\u6709\u65b9\u6cd5\u7684\u7d9c\u5408\u6307\u5357"},"content":{"rendered":"<p>\u60a8\u7684 PowerShell \u662f\u5426\u904b\u884c\u7de9\u6162\u3001\u8fd4\u56de\u932f\u8aa4\u3001\u751a\u81f3\u62d2\u7d55\u555f\u52d5\uff1f\u5982\u679c\u60a8\u61f7\u7591\u60a8\u7684 PowerShell \u7248\u672c\u5df2\u904e\u6642\uff0c\u90a3\u9ebc\u9019\u662f\u4e00\u500b\u5f88\u597d\u7684\u6a5f\u6703\u4f86\u5347\u7d1a\u5230\u6700\u65b0\u7248\u672c\u4e26\u78ba\u4fdd\u66f4\u6d41\u66a2\u7684\u529f\u80fd\u3002<\/p>\n<p>\u5728\u6df1\u5165\u66f4\u65b0\u4e4b\u524d\uff0c\u9a57\u8b49\u76ee\u524d\u7684 PowerShell \u7248\u672c\u81f3\u95dc\u91cd\u8981\u3002\u4e0b\u9762\uff0c\u60a8\u5c07\u627e\u5230\u4e00\u500b\u7c21\u55ae\u7684\u6307\u5357\uff0c\u5176\u4e2d\u4ecb\u7d39\u4e86\u5728 Windows \u7cfb\u7d71\u4e0a\u66f4\u65b0 PowerShell \u7684\u5404\u7a2e\u65b9\u6cd5\u3002\u8b93\u6211\u5011\u958b\u59cb\u5427\uff01<\/p>\n<h2><span id=\"install_or_update_with_winget\"><strong>1.\u4f7f\u7528 Winget \u6307\u4ee4\u66f4\u65b0 PowerShell<\/strong><\/span><\/h2>\n<p>\u5728 Windows \u4e0a\u5b89\u88dd\u6216\u5347\u7d1a PowerShell \u7684\u6700\u6709\u6548\u65b9\u6cd5\u662f\u5229\u7528 Winget \u547d\u4ee4\uff0c\u9019\u662f\u4e00\u500b\u5f37\u5927\u7684 Windows \u5957\u4ef6\u7ba1\u7406\u5668\uff0c\u53ef\u4ee5\u7c21\u5316\u61c9\u7528\u7a0b\u5f0f\u7684\u5b89\u88dd\u548c\u66f4\u65b0\u3002\u5177\u9ad4\u64cd\u4f5c\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li><strong>\u958b\u555f\u547d\u4ee4\u63d0\u793a\u5b57\u5143\uff1a<\/strong>\u5728 Windows 11 \u641c\u5c0b\u5217\u4e2d\u641c\u5c0b\u300c\u547d\u4ee4\u63d0\u793a\u5b57\u5143\u300d\u3002\u53f3\u9375\u55ae\u64ca\u5b83\u4e26\u9078\u64c7<strong>\u4ee5\u7ba1\u7406\u54e1\u8eab\u4efd\u904b\u884c<\/strong>\u3002<\/li>\n<li><\/li>\n<li><strong>\u57f7\u884c\u641c\u5c0b\u547d\u4ee4\uff1a<\/strong>\u5728\u547d\u4ee4\u63d0\u793a\u5b57\u5143\u4e2d\uff0c\u8f38\u5165\u547d\u4ee4<code><strong>winget search PowerShell<\/strong><\/code>\u4e26\u6309<strong>Enter<\/strong>\u3002<\/li>\n<li><\/li>\n<li><strong>\u8a18\u4e0b\u61c9\u7528\u7a0b\u5f0f ID\uff1a<\/strong>\u89c0\u5bdf\u8207<strong>PowerShell\u61c9\u7528\u7a0b\u5f0f\u95dc\u806f\u7684<\/strong><strong>ID<\/strong>\uff0c\u4ee5\u4fbf\u57f7\u884c\u5f8c\u7e8c\u6b65\u9a5f\u3002<strong><\/strong><\/li>\n<li><\/li>\n<li><strong>\u5b89\u88dd\/\u66f4\u65b0 PowerShell\uff1a<\/strong>\u4f7f\u7528\u6307\u4ee4<code><strong>winget install AppID<\/strong><\/code>\uff0c\u78ba\u4fdd\u7528\u60a8\u5148\u524d\u8a18\u4e0b\u7684 ID\u53d6\u4ee3<strong>AppID \u3002<\/strong><\/li>\n<li><\/li>\n<\/ul>\n<h2><span id=\"install_or_update_from_github\"><strong>2.\u5f9e GitHub \u5b89\u88dd\u6216\u66f4\u65b0 PowerShell<\/strong><\/span><\/h2>\n<p>\u5982\u679c\u60a8\u4e0d\u60f3\u4f7f\u7528\u547d\u4ee4\u5217\uff0c\u4e5f\u53ef\u4ee5\u900f\u904e\u76f4\u63a5\u5f9e GitHub \u4e0b\u8f09\u4f86\u66f4\u65b0 PowerShell\u3002\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li><strong>\u9020\u8a2a GitHub \u9801\u9762\uff1a<\/strong>\u958b\u555f\u60a8\u7684 Web \u700f\u89bd\u5668\u4e26\u524d\u5f80<strong><a data-wpel-link=\"external\" href=\"https:\/\/github.com\/PowerShell\/PowerShell#get-powershell\" rel=\"noopener nofollow external noreferrer\" target=\"_blank\">PowerShell GitHub \u9801\u9762<\/a><\/strong>\u3002<\/li>\n<li><strong>\u9078\u64c7\u4e0b\u8f09\u9078\u9805\uff1a<\/strong>\u5728\u9801\u9762\u4e0a\uff0c\u60a8\u5c07\u770b\u5230\u4e0d\u540c\u7684\u4e0b\u8f09\u9078\u9805\u3002 msi \u6a94\u6848\uff08LTS\u3001\u7a69\u5b9a\u7248\u3001\u9810\u89bd\u7248\uff09\u3002\u9078\u64c7<strong>\u7a69\u5b9a\u7248\u672c<\/strong>\u3002<\/li>\n<li><\/li>\n<li><strong>\u5b89\u88dd MSI \u6a94\u6848\uff1a<\/strong>\u4e0b\u8f09\u5f8c\uff0c\u96d9\u64ca MSI \u6a94\u6848\u5373\u53ef\u958b\u59cb\u5b89\u88dd\u3002<\/li>\n<li><strong>\u8acb\u4f9d\u7167\u5b89\u88dd\u63d0\u793a\uff1a<\/strong>\u5b89\u88dd\u904e\u7a0b\u4e2d\u4f9d\u7167\u9810\u8a2d\u9078\u64c7\u9032\u884c\uff0c\u7136\u5f8c\u6309\u4e00\u4e0b<strong>\u300c\u4e0b\u4e00\u6b65\u300d<\/strong>\u3002<\/li>\n<li><\/li>\n<li><strong>\u5b8c\u6210\u5b89\u88dd\uff1a<\/strong>\u7b49\u5f85\u5b89\u88dd\u7a0b\u5e8f\u5b8c\u6210\u3002<\/li>\n<li><\/li>\n<\/ul>\n<h2><span id=\"update_from_microsoft_store\"><strong>3.\u900f\u904e Microsoft Store \u66f4\u65b0 PowerShell<\/strong><\/span><\/h2>\n<p>\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f Windows 11\uff0c\u5b89\u88dd\u6216\u66f4\u65b0 PowerShell \u7684\u53e6\u4e00\u7a2e\u76f4\u63a5\u65b9\u6cd5\u662f\u900f\u904e Microsoft Store\u3002\u8acb\u4f9d\u7167\u4ee5\u4e0b\u6b65\u9a5f\u64cd\u4f5c\uff1a<\/p>\n<ul>\n<li><strong>\u958b\u555f Microsoft Store\uff1a<\/strong>\u5728 Windows 11 \u641c\u5c0b\u5217\u4e2d\u641c\u5c0b\u300cMicrosoft Store\u300d\u4e26\u555f\u52d5\u61c9\u7528\u7a0b\u5f0f\u3002 <img alt=\"Microsoft Store\" class=\"wp-image\" decoding=\"async\" height=\"553\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2025\/02\/Microsoft-Store-1.webp\" title=\"Microsoft Store\" width=\"640\"\/> <\/li>\n<li><strong>\u641c\u5c0b PowerShell\uff1a<\/strong>\u4f7f\u7528\u5546\u5e97\u5167\u7684\u641c\u5c0b\u529f\u80fd\u5c0b\u627e<strong>PowerShell<\/strong>\u3002<\/li>\n<li><\/li>\n<li><strong>\u66f4\u65b0\u6216\u5b89\u88dd PowerShell\uff1a<\/strong>\u5982\u679c\u6709\u53ef\u7528\u66f4\u65b0\uff0c\u8acb\u6309\u4e00\u4e0b<strong>\u66f4\u65b0<\/strong>\u6309\u9215\u3002\u5982\u679c\u5c1a\u672a\u5b89\u88dd\uff0c\u8acb\u6309\u4e00\u4e0b<strong>\u300c\u5b89\u88dd\u300d<\/strong>\u3002<\/li>\n<\/ul>\n<h3><span id=\"use_both_versions\"><strong>\u540c\u6642\u4f7f\u7528 PowerShell 5 \u548c PowerShell 7<\/strong><\/span><\/h3>\n<p>\u6309\u7167\u4e0a\u8ff0\u5b89\u88dd\u6b65\u9a5f\uff0c\u60a8\u7684\u7cfb\u7d71\u4e0a\u73fe\u5728\u53ef\u4ee5\u540c\u6642\u64c1\u6709 PowerShell 5 \u548c PowerShell 7\u3002 PowerShell 7.x \u4f4d\u65bc\u4e0d\u540c\u7684\u76ee\u9304\u4e2d\uff0c\u4f46\u5169\u500b\u7248\u672c\u53ef\u4ee5\u540c\u6642\u904b\u4f5c\u3002\u5982\u679c\u60a8\u662f\u7d42\u7aef\u7528\u6236\uff0c\u5247\u9700\u8981\u984d\u5916\u7684 PowerShell \u8a2d\u5b9a\u6a94\u4f86\u6709\u6548\u5730\u7ba1\u7406\u9019\u5169\u7a2e\u74b0\u5883\u3002<\/p>\n<p>\u672c\u7d9c\u5408\u6307\u5357\u65e8\u5728\u5354\u52a9\u60a8\u5728 Windows \u7cfb\u7d71\u4e0a\u66f4\u65b0\u6216\u5b89\u88dd PowerShell\u3002\u5982\u679c\u60a8\u9700\u8981\u9032\u4e00\u6b65\u7684\u5354\u52a9\uff0c\u8acb\u96a8\u6642\u8207\u6211\u5011\u806f\u7e6b\u3002\u5982\u679c\u60a8\u767c\u73fe\u672c\u6307\u5357\u6709\u7528\uff0c\u8acb\u8207\u60a8\u7684\u670b\u53cb\u5206\u4eab\uff0c\u4ee5\u5e6b\u52a9\u4ed6\u5011\u589e\u5f37\u4ed6\u5011\u7684 PowerShell \u9ad4\u9a57\uff01<\/p>\n<h2>\u5e38\u898b\u554f\u984c<\/h2>\n<h3><strong>1.\u6211\u5982\u4f55\u77e5\u9053\u6211\u76ee\u524d\u64c1\u6709\u54ea\u500b\u7248\u672c\u7684 PowerShell\uff1f<\/strong><\/h3>\n<p>\u60a8\u53ef\u4ee5\u900f\u904e\u958b\u555f PowerShell \u672c\u8eab\u4e26\u8f38\u5165\u547d\u4ee4\u4f86\u627e\u5230\u76ee\u524d\u7684 PowerShell \u7248\u672c<code>$PSVersionTable. PSVersion<\/code>\u3002\u9019\u5c07\u986f\u793a\u60a8\u7684\u7248\u672c\u865f\u3002<\/p>\n<h3><strong>2.\u6211\u53ef\u4ee5\u540c\u6642\u57f7\u884c PowerShell 5 \u548c PowerShell 7 \u55ce\uff1f<\/strong><\/h3>\n<p>\u662f\u7684\uff0c\u60a8\u53ef\u4ee5\u5728 Windows \u6a5f\u5668\u4e0a\u57f7\u884c PowerShell 5 \u548c PowerShell 7\u3002\u5b83\u5011\u53ef\u4ee5\u7368\u7acb\u904b\u884c\uff0c\u4e5f\u53ef\u4ee5\u540c\u6642\u4f7f\u7528\u3002<\/p>\n<h3><strong>3. Winget\u547d\u4ee4\u4e0d\u8d77\u4f5c\u7528\u600e\u9ebc\u8fa6\uff1f<\/strong><\/h3>\n<p>\u5982\u679c Winget \u547d\u4ee4\u5931\u6557\uff0c\u8acb\u78ba\u4fdd\u5b83\u5df2\u5b89\u88dd\u4e26\u4e14\u60a8\u7684 Windows \u7cfb\u7d71\u5df2\u66f4\u65b0\u81f3\u6700\u65b0\u7248\u672c\u3002\u6216\u8005\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 GitHub \u4e0b\u8f09\u65b9\u6cd5\u6216 Microsoft Store \u66f4\u65b0 PowerShell\u3002<\/p>\n<p><a class=\"xiaomi\" href=\"https:\/\/techviral.net\/update-powershell-windows\/\" rel=\"noopener noreferrer nofollow\" target=\"_blank\">\u4f86\u6e90\u548c\u5716\u7247<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u60a8\u7684 PowerShell \u662f\u5426\u904b\u884c\u7de9\u6162\u3001\u8fd4\u56de\u932f\u8aa4\u3001\u751a\u81f3\u62d2\u7d55\u555f\u52d5\uff1f\u5982\u679c\u60a8\u61f7\u7591\u60a8\u7684 PowerShell \u7248\u672c\u5df2\u904e\u6642\uff0c\u90a3\u9ebc\u9019\u662f\u4e00\u500b\u5f88\u597d\u7684\u6a5f\u6703\u4f86\u5347\u7d1a\u5230\u6700\u65b0\u7248\u672c\u4e26\u78ba\u4fdd\u66f4\u6d41\u66a2\u7684\u529f\u80fd\u3002 \u5728\u6df1\u5165\u66f4\u65b0\u4e4b\u524d\uff0c\u9a57\u8b49\u76ee\u524d\u7684 PowerShell \u7248\u672c\u81f3\u95dc\u91cd\u8981\u3002\u4e0b\u9762\uff0c\u60a8\u5c07\u627e\u5230\u4e00\u500b\u7c21\u55ae\u7684\u6307\u5357\uff0c\u5176\u4e2d\u4ecb\u7d39\u4e86\u5728 Windows \u7cfb\u7d71\u4e0a\u66f4\u65b0 PowerShell \u7684\u5404\u7a2e\u65b9\u6cd5\u3002\u8b93\u6211\u5011\u958b\u59cb\u5427\uff01 1.\u4f7f\u7528 Winget \u6307\u4ee4\u66f4\u65b0 PowerShell \u5728 Windows \u4e0a\u5b89\u88dd\u6216\u5347\u7d1a PowerShell \u7684\u6700\u6709\u6548\u65b9\u6cd5\u662f\u5229\u7528 Winget \u547d\u4ee4\uff0c\u9019\u662f\u4e00\u500b\u5f37\u5927\u7684 Windows \u5957\u4ef6\u7ba1\u7406\u5668\uff0c\u53ef\u4ee5\u7c21\u5316\u61c9\u7528\u7a0b\u5f0f\u7684\u5b89\u88dd\u548c\u66f4\u65b0\u3002\u5177\u9ad4\u64cd\u4f5c\u5982\u4e0b\uff1a \u958b\u555f\u547d\u4ee4\u63d0\u793a\u5b57\u5143\uff1a\u5728 Windows 11 \u641c\u5c0b\u5217\u4e2d\u641c\u5c0b\u300c\u547d\u4ee4\u63d0\u793a\u5b57\u5143\u300d\u3002\u53f3\u9375\u55ae\u64ca\u5b83\u4e26\u9078\u64c7\u4ee5\u7ba1\u7406\u54e1\u8eab\u4efd\u904b\u884c\u3002 \u57f7\u884c\u641c\u5c0b\u547d\u4ee4\uff1a\u5728\u547d\u4ee4\u63d0\u793a\u5b57\u5143\u4e2d\uff0c\u8f38\u5165\u547d\u4ee4winget search PowerShell\u4e26\u6309Enter\u3002 \u8a18\u4e0b\u61c9\u7528\u7a0b\u5f0f ID\uff1a\u89c0\u5bdf\u8207PowerShell\u61c9\u7528\u7a0b\u5f0f\u95dc\u806f\u7684ID\uff0c\u4ee5\u4fbf\u57f7\u884c\u5f8c\u7e8c\u6b65\u9a5f\u3002 \u5b89\u88dd\/\u66f4\u65b0 PowerShell\uff1a\u4f7f\u7528\u6307\u4ee4winget install AppID\uff0c\u78ba\u4fdd\u7528\u60a8\u5148\u524d\u8a18\u4e0b\u7684 ID\u53d6\u4ee3AppID \u3002 2.\u5f9e GitHub \u5b89\u88dd\u6216\u66f4\u65b0 PowerShell \u5982\u679c\u60a8\u4e0d\u60f3\u4f7f\u7528\u547d\u4ee4\u5217\uff0c\u4e5f\u53ef\u4ee5\u900f\u904e\u76f4\u63a5\u5f9e GitHub \u4e0b\u8f09\u4f86\u66f4\u65b0 PowerShell\u3002\u65b9\u6cd5\u5982\u4e0b\uff1a \u9020\u8a2a GitHub \u9801\u9762\uff1a\u958b\u555f\u60a8\u7684 Web \u700f\u89bd\u5668\u4e26\u524d\u5f80PowerShell GitHub \u9801\u9762\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6],"class_list":["post-8038","post","type-post","status-publish","format-standard","hentry","category-how-to","tag-windows"],"acf":[],"_links":{"self":[{"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/posts\/8038","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/comments?post=8038"}],"version-history":[{"count":1,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/posts\/8038\/revisions"}],"predecessor-version":[{"id":8039,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/posts\/8038\/revisions\/8039"}],"wp:attachment":[{"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/media?parent=8038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/categories?post=8038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/tags?post=8038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}