{"id":384,"date":"2022-02-28T20:47:41","date_gmt":"2022-02-28T12:47:41","guid":{"rendered":"http:\/\/benson.ml\/?p=384"},"modified":"2022-03-23T13:12:47","modified_gmt":"2022-03-23T05:12:47","slug":"win10%e4%bd%bf%e7%94%a8powershell%e5%91%bd%e4%bb%a4%e8%ae%a9%e5%b1%80%e5%9f%9f%e7%bd%91%e7%94%b5%e8%84%91%e9%87%8d%e5%90%af%e5%85%b3%e6%9c%ba%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/benson80.eu.org\/?p=384","title":{"rendered":"Win10\u4f7f\u7528PowerShell\u547d\u4ee4\u8ba9\u5c40\u57df\u7f51\u7535\u8111\u91cd\u542f\u5173\u673a\u64cd\u4f5c"},"content":{"rendered":"\n<p>\u73b0\u5728\u5fae\u8f6f\u5927\u529b\u63a8\u884c\u5728Win10\u4e2d\u4f7f\u7528Powershell\u6765\u66ff\u4ee3CMD\uff0cPowershell\u7684\u529f\u80fd\u786e\u5b9e\u8981\u5f3a\u5927\u7684\u591a\uff0c\u800c\u4e14\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528Windows Powershell\u6765\u8ba9\u7535\u8111\u91cd\u542f\u3001\u5173\u673a\u7b49\u64cd\u4f5c\uff0c\u4e5f\u53ef\u4ee5\u63a7\u5236\u5c40\u57df\u7f51\u7535\u8111\uff0c\u8fd8\u4e0d\u77e5\u9053\u7684\u670b\u53cb\u4e00\u8d77\u6765\u5b66\u4e60\u4e00\u4e0b\u8fd9\u4e2a\u6559\u7a0b\u5427\u3002<\/p>\n\n\n\n<p><strong>\u7528Powershell\u547d\u4ee4\u8ba9\u4e00\u53f0\u8ba1\u7b97\u673a\u91cd\u542f<\/strong><\/p>\n\n\n\n<p>\u547d\u4ee4\u6bd4\u8f83\u7b80\u5355\uff0c\u76f4\u63a5\u8f93\u5165\uff1aRestart-Computer<\/p>\n\n\n\n<p>\u63d0\u793a1\uff1a\u6267\u884c\u8fd9\u4e2a\u547d\u4ee4\u540e\uff0c\u8ba1\u7b97\u673a\u4f1a\u9a6c\u4e0a\u91cd\u542f\uff0c\u5982\u679c\u8ba1\u7b97\u673a\u6587\u4ef6\u8fd8\u6ca1\u6709\u4fdd\u5b58\u597d\uff0c\u8bf7\u4e0d\u8981\u6267\u884c\u8fd9\u4e2a\u547d\u4ee4<\/p>\n\n\n\n<p><strong>\u7528Powershell\u547d\u4ee4\u8ba9\u591a\u53f0\u8ba1\u7b97\u673a\u96c6\u4f53\u91cd\u542f<\/strong><\/p>\n\n\n\n<p>\u8fd9\u6761\u547d\u4ee4\u9002\u5408\u7ba1\u7406\u5458\u4f7f\u7528\uff0c\u5c24\u5176\u662f\u5728\u8981\u91cd\u542f\u591a\u53f0\u8ba1\u7b97\u673a\u7684\u60c5\u51b5\u4e0b\uff0c\u7528\u8fd9\u6761\u547d\u4ee4\u4f1a\u6bd4\u4e00\u53f0\u53f0\u8ba1\u7b97\u673a\u53bb\u91cd\u542f\u65b9\u4fbf\u5f97\u591a<\/p>\n\n\n\n<p>\u547d\u4ee4\u884c\uff1aRestart-Computer -ComputerName &#8220;Server01&#8221;, &#8220;Server02&#8221;, &#8220;localhost&#8221;<\/p>\n\n\n\n<p>\u63d0\u793a2\uff1a\u8fd9\u91cc\u9762\uff0c\u5f15\u53f7\u4e2d\u7684\u5185\u5bb9\u4e3a\u662f\u5177\u4f53\u7535\u8111\u5728\u5c40\u57df\u7f51\u4e2d\u7684\u540d\u79f0\uff0c\u800c\u201clocalhost\u201d\u4e3a\u672c\u673a<\/p>\n\n\n\n<p><strong>\u7528Powershell\u547d\u4ee4\u8ba9\u8fdc\u7a0b\u7535\u8111\u91cd\u542f<\/strong><\/p>\n\n\n\n<p>\u5bf9\u4e8e\u9700\u8981\u8fdc\u7a0b\u91cd\u542f\u7684\u8ba1\u7b97\u673a\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u91cd\u542f\u5ef6\u8fdf\u65f6\u95f4\uff1b<\/p>\n\n\n\n<p>\u547d\u4ee4\u884c\uff1aRestart-Computer -ComputerName &#8220;Server01&#8221; -Wait -For PowerShell -Timeout 600 -Delay 5<\/p>\n\n\n\n<p>\u63d0\u793a3\uff1a\u5176\u4e2d\u201c600\u201d\u662f\u79d2\u6570\uff0c600\u79d2\u4e5f\u5c31\u662f10\u5206\u949f\u3002\u8fd9\u6761\u547d\u4ee4\u662f\u8ba9\u8fdc\u7a0b\u8ba1\u7b97\u673a\u6700\u591a\u7b49\u5f85PowerShell\u542f\u52a8\u5b8c\u6bd5\u5341\u5206\u949f\uff1b\u5ef6\u8fdf\u4e3a5\u79d2\uff0c\u610f\u4e3a\u6bcf5\u79d2\u67e5\u8be2\u4e00\u6b21PowerShell\u542f\u52a8\u60c5\u51b5\u3002\u5982\u679c\u5728\u5341\u5206\u949f\u5185PowerShell\u542f\u52a8\uff0c\u5219\u5728\u53d1\u73b0\u6210\u529f\u542f\u52a8\u540e\u7acb\u5373\u91cd\u542f\uff1b\u5982\u679c\u5341\u5206\u949f\u5230\u65f6\u540e\u4ecd\u672a\u542f\u52a8PowerShell\uff0c\u5219\u8fdc\u7a0b\u8ba1\u7b97\u673a\u5c06\u91cd\u542f\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73b0\u5728\u5fae\u8f6f\u5927\u529b\u63a8\u884c\u5728Win10\u4e2d\u4f7f\u7528Powershe &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-384","post","type-post","status-publish","format-standard","hentry","category-windows"],"_links":{"self":[{"href":"https:\/\/benson80.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/384","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/benson80.eu.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benson80.eu.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benson80.eu.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benson80.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=384"}],"version-history":[{"count":3,"href":"https:\/\/benson80.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/384\/revisions"}],"predecessor-version":[{"id":392,"href":"https:\/\/benson80.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/384\/revisions\/392"}],"wp:attachment":[{"href":"https:\/\/benson80.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benson80.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benson80.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}