{"id":38878,"date":"2024-11-26T10:47:10","date_gmt":"2024-11-26T02:47:10","guid":{"rendered":"https:\/\/fwq.ai\/blog\/38878\/"},"modified":"2024-11-26T10:47:10","modified_gmt":"2024-11-26T02:47:10","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8windows-powershell%e4%b8%ad%e5%90%af%e7%94%a8%e5%92%8c%e4%bd%bf%e7%94%a8%e8%84%9a%e6%9c%ac%e6%89%a7%e8%a1%8c%e7%ad%96%e7%95%a5","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/38878\/","title":{"rendered":"\u5982\u4f55\u5728Windows PowerShell\u4e2d\u542f\u7528\u548c\u4f7f\u7528\u811a\u672c\u6267\u884c\u7b56\u7565"},"content":{"rendered":"<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cipowershell \u5141\u8bb8\u60a8\u901a\u8fc7\u5176\u63a7\u5236\u53f0\u8fd0\u884c\u547d\u4ee4 (cmdlet)\u3002 \u8981\u6267\u884c\u811a\u672c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u811a\u672c\u4ee3\u7801\u521b\u5efa\u4e00\u4e2a\u8bb0\u4e8b\u672c\u6587\u4ef6\uff0c\u4f7f\u7528 .ps1 \u6587\u4ef6\u6269\u5c55\u540d\u4fdd\u5b58\u5b83\uff0c\u7136\u540e\u901a\u8fc7 powershell \u63a7\u5236\u53f0\u6267\u884c\u5b83\u3002 \u4e5f\u53ef\u4ee5\u76f4\u63a5\u5c06\u811a\u672c\u7c98\u8d34\u5230\u63a7\u5236\u53f0\u6267\u884c\u3002<\/p>\n<p>\u4f46\u662f\uff0c\u5982\u679c\u8fd9\u662f\u60a8\u7b2c\u4e00\u6b21\u901a\u8fc7 PowerShell\u6267\u884c\u811a\u672c\uff0c\u60a8\u4f1a\u9047\u5230\u201c\u6b63\u5728\u8fd0\u884c\u7684\u811a\u672c\u5df2\u88ab\u7981\u7528\u201d\u9519\u8bef\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u7981\u7528 PowerShell \u4e0a\u7684\u811a\u672c\u6267\u884c\u4f5c\u4e3a\u4e00\u9879\u5b89\u5168\u63aa\u65bd\uff0c\u4ee5\u9632\u6b62\u6076\u610f\u811a\u672c\u5728\u60a8\u7684\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002 \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5411\u60a8\u5c55\u793a\u4e86\u5728 Windows PowerShell \u4e0a\u542f\u7528\u811a\u672c\u6267\u884c\u7b56\u7565\u7684\u4e24\u79cd\u65b9\u6cd5\u3002<\/p>\n<h2>\u5982\u4f55\u68c0\u67e5\u60a8\u73b0\u6709\u7684\u6267\u884c\u7b56\u7565<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/172835234647436.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5728Windows PowerShell\u4e2d\u542f\u7528\u548c\u4f7f\u7528\u811a\u672c\u6267\u884c\u7b56\u7565\u63d2\u56fe\" alt=\"\u5982\u4f55\u5728Windows PowerShell\u4e2d\u542f\u7528\u548c\u4f7f\u7528\u811a\u672c\u6267\u884c\u7b56\u7565\u63d2\u56fe\" \/><\/p>\n<li>\u5b8c\u6210\u540e\uff0c\u6253\u5f00 PowerShell\uff0c\u952e\u5165 get <strong>executionpolicy <\/strong><strong>\u6267\u884c\u653f\u7b56\uff0c<\/strong> \u5e76\u6309\u4e0b <strong>Enter<\/strong><strong>\u8fdb\u5165<\/strong>. \u5f53\u524d\u7528\u6237\u7684\u6267\u884c\u7b56\u7565\u73b0\u5728\u8bbe\u7f6e\u4e3a <strong>RemoteSigned<\/strong><strong>\u8fdc\u7a0b\u7b7e\u540d\u3002<\/strong> <\/li>\n<li>\u5982\u679c\u9700\u8981\u7981\u7528\u6267\u884c\u7b56\u7565\uff0c\u8bf7\u5207\u6362 PowerShell \u5f00\u5173\u5e76\u5c06\u5176\u8bbe\u7f6e\u4e3a <strong>Off<\/strong>.<\/li>\n<h2>\u5982\u4f55\u4f7f\u7528 PowerShell \u5141\u8bb8\u811a\u672c\u5728 PowerShell \u4e2d\u8fd0\u884c<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/172835234646341.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5728Windows PowerShell\u4e2d\u542f\u7528\u548c\u4f7f\u7528\u811a\u672c\u6267\u884c\u7b56\u7565\u63d2\u56fe1\" alt=\"\u5982\u4f55\u5728Windows PowerShell\u4e2d\u542f\u7528\u548c\u4f7f\u7528\u811a\u672c\u6267\u884c\u7b56\u7565\u63d2\u56fe1\" \/><\/p>\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528 PowerShell cmdlet \u5c06\u6267\u884c\u7b56\u7565\u8bbe\u7f6e\u4e3a RemoteSigned\u3002 \u547d\u4ee4\u884c\u754c\u9762\u4f7f\u60a8\u65e0\u9700\u4f7f\u7528\u201c\u8bbe\u7f6e\u201d\u5e94\u7528\u7a0b\u5e8f\u5373\u53ef\u8f7b\u677e\u5feb\u901f\u66f4\u6539\u6267\u884c\u7b56\u7565\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u8bbe\u7f6e\u5e94\u7528\u7a0b\u5e8f\u53ea\u80fd\u542f\u7528\u6216\u7981\u7528 RemoteSigned \u6267\u884c\u7b56\u7565\u3002 \u800c PowerShell \u8fd8\u5141\u8bb8\u60a8\u8bbe\u7f6e\u5176\u4ed6\u7b56\u7565\u548c\u8303\u56f4\u3002<\/p>\n<p>\u8981\u4f7f\u7528 PowerShell \u66f4\u6539\u6267\u884c\u7b56\u7565\uff1a<\/p>\n<ol>\n<li>\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u6253\u5f00 PowerShell\u3002<\/li>\n<li>\u5728 PowerShell \u7a97\u53e3\u4e2d\uff0c\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\u5e76\u6309 <strong>Enter<\/strong><strong>\u8fdb\u5165<\/strong>:\n<pre>Set-ExecutionPolicy RemoteSigned<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236  <\/li>\n<li>\u5982\u679c\u51fa\u73b0\u63d0\u793a\uff0c\u8bf7\u6309<strong> A<\/strong> \u786e\u8ba4\u52a8\u4f5c\u3002 \u8fd9\u5c06\u8bbe\u7f6e <strong>RemoteSigned <\/strong><strong>\u8fdc\u7a0b\u7b7e\u540d<\/strong> \u6240\u6709\u7528\u6237\u7684\u6267\u884c\u7b56\u7565\u3002 \u5982\u679c\u4f60\u60f3\u4e3a <strong>Current User&nbsp;<\/strong><strong>\u5f53\u524d\u7528\u6237 <\/strong>\u4ec5\u4f7f\u7528 Scope \u53c2\u6570\u540e\u8ddf\u7528\u6237\u540d\u3002<\/li>\n<li>\u4f8b\u5982\uff0c\u8bbe\u7f6e <strong>RemoteSigned <\/strong><strong>\u8fdc\u7a0b\u7b7e\u540d <\/strong>\u7684\u6267\u884c\u653f\u7b56 <strong>CurrentUser<\/strong><strong>\u5f53\u524d\u7528\u6237<\/strong>\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a\n<pre>Set-ExecutionPolicy RemoteSgined -Scope CurrentUser<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236  <\/li>\n<li>\u4ee3\u66ff <strong>\u5f53\u524d\u7528\u6237 <\/strong>\u6839\u636e\u60a8\u7684\u8981\u6c42\uff0c\u5728\u4e0a\u8ff0\u547d\u4ee4\u4e2d\u4e0e\u5176\u4ed6\u7528\u6237\uff08\u8303\u56f4\uff09\u4e00\u8d77\u4f7f\u7528\u3002<\/li>\n<\/ol>\n<h2>\u5982\u4f55\u4f7f\u7528 PowerShell \u5220\u9664\u811a\u672c\u6267\u884c\u7b56\u7565<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/172835234633264.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5728Windows PowerShell\u4e2d\u542f\u7528\u548c\u4f7f\u7528\u811a\u672c\u6267\u884c\u7b56\u7565\u63d2\u56fe2\" alt=\"\u5982\u4f55\u5728Windows PowerShell\u4e2d\u542f\u7528\u548c\u4f7f\u7528\u811a\u672c\u6267\u884c\u7b56\u7565\u63d2\u56fe2\" \/><\/p>\n<p>\u5982\u679c\u8981\u7981\u7528\u811a\u672c\u6267\u884c\uff0c\u8bf7\u5c06\u6267\u884c\u7b56\u7565\u8bbe\u7f6e\u4e3a <strong>Undefined&nbsp; <\/strong><strong>\u4e0d\u660e\u786e\u7684 <\/strong>\u4f7f\u7528<strong>e Set_ExecutionPolicy <\/strong>\u547d\u4ee4\u3002 \u8fd9\u662f\u9ed8\u8ba4\u72b6\u6001\uff0c\u53ef\u9632\u6b62 PowerShell \u6267\u884c\u4efb\u4f55\u811a\u672c\u3002<\/p>\n<p>\u8981\u4f7f\u7528 PowerShell \u7981\u7528\u811a\u672c\u6267\u884c\uff1a<\/p>\n<ol>\n<li>\u4f7f\u7528\u63d0\u5347\u7684\u6743\u9650\u6253\u5f00 PowerShell\u3002<\/li>\n<li>\u63a5\u4e0b\u6765\uff0c\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\u5e76\u6309 enter \u952e\u4ee5\u7981\u7528\u6240\u6709\u7528\u6237\u7684\u811a\u672c\u6267\u884c\uff1a\n<pre>Set-ExecutionPolicy undefined<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236  <\/li>\n<li>\u4e0a\u9762\u7684\u547d\u4ee4\u5c06\u4e3a\u6240\u6709\u7528\u6237\u8bbe\u7f6e\u6267\u884c\u7b56\u7565\u9ed8\u8ba4\u503c\uff08\u672a\u5b9a\u4e49\uff09\u3002 \u5982\u679c\u8981\u4e3a\u7279\u5b9a\u8303\u56f4\u7981\u7528\u811a\u672c\u6267\u884c\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a\n<pre>Set-ExecutionPolicy undefined -Scope CurrentUser<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236  <\/li>\n<li>\u4e0a\u9762\u7684\u547d\u4ee4\u5c06\u7981\u7528\u811a\u672c\u6267\u884c <strong>CurrentUser <\/strong><strong>\u5f53\u524d\u7528\u6237<\/strong>.<\/li>\n<\/ol>\n<h2>\u4e86\u89e3\u6267\u884c\u7b56\u7565\u548c\u8303\u56f4<\/h2>\n<p>\u7b80\u5355\u7684\u8bf4\uff0cPowerShell\u7684\u6267\u884c\u7b56\u7565\u5c31\u662f\u63a7\u5236PowerShell\u5982\u4f55\u6267\u884c\u914d\u7f6e\u6587\u4ef6\u548c\u811a\u672c\u7684\u7b56\u7565\u3002 \u9884\u671f\u76ee\u7684\u662f\u9632\u6b62\u7528\u6237\u610f\u5916\u8fd0\u884c\u6076\u610f\u811a\u672c\u3002 \u4e03\u4e2a PowerShell \u6267\u884c\u7b56\u7565\u662f <strong>Default, Restricted, RemoteSigned, AllSigned, Unrestricted, Bypass, and Undefined <\/strong><strong>\u9ed8\u8ba4\u3001\u53d7\u9650\u3001RemoteSigned\u3001AllSigned\u3001\u4e0d\u53d7\u9650\u3001\u65c1\u8def\u548c\u672a\u5b9a\u4e49<\/strong>.<\/p>\n<p>\u4e0b\u8868\u7b80\u8981\u8bf4\u660e\u4e86\u6240\u6709 PowerShell \u6267\u884c\u7b56\u7565\uff1a<\/p>\n<table border=\"1\" style=\"color:#f60;text-decoration:underline\">\n  lspacing=&#8221;1&#8243; cellpadding=&#8221;1&#8243;&gt; <\/p>\n<tbody>\n<tr>\n<td style=\"vertical-align: top;width: 301px;border: 1pxsolidblack\">\u6267\u884c\u653f\u7b56<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: 1pxsolidblack;vertical-align: top;width: 301px\">\u6267\u6cd5<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1pxsolidblack;border-left: 1pxsolidblack;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u9ed8\u8ba4<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u5c06\u9ed8\u8ba4\u6267\u884c\u7b56\u7565\u8bbe\u7f6e\u4e3a Restricted on Windows Client \u548c RemoteSigned on Windows Server\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1pxsolidblack;border-left: 1pxsolidblack;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">AllSigned<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u5141\u8bb8\u6267\u884c\u53d1\u5e03\u8005\u7b7e\u540d\u7684\u811a\u672c\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1pxsolidblack;border-left: 1pxsolidblack;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u65c1\u8def<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u4e0d\u53d7\u9650\u5236\u5730\u6267\u884c\u5927\u578b\u5e94\u7528\u7a0b\u5e8f\u7684\u811a\u672c\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1pxsolidblack;border-left: 1pxsolidblack;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u8fdc\u7a0b\u7b7e\u540d<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u5141\u8bb8\u672c\u5730\u7f16\u5199\u7684\u811a\u672c\u6267\u884c\u3002 \u4ece Internet \u4e0b\u8f7d\u7684\u811a\u672c\u9700\u8981\u6570\u5b57\u7b7e\u540d\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1pxsolidblack;border-left: 1pxsolidblack;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u53d7\u9650\u5236\u7684<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u4e0d\u5141\u8bb8\u811a\u672c\u6267\u884c\uff0c\u4f46\u53ea\u5141\u8bb8\u6267\u884c\u5355\u4e2a PowerShell \u547d\u4ee4\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1pxsolidblack;border-left: 1pxsolidblack;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u4e0d\u660e\u786e\u7684<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u5c06\u6267\u884c\u7b56\u7565\u8bbe\u7f6e\u4e3a Restricted for Windows clients \u548c RemoteSigned for Windows Server\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1pxsolidblack;border-left: 1pxsolidblack;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u65e0\u9650\u5236<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u5141\u8bb8\u6267\u884c\u672a\u7b7e\u540d\u7684\u811a\u672c\uff0c\u5e76\u5bf9\u4ece Internet \u4e0b\u8f7d\u7684\u811a\u672c\u53d1\u51fa\u8b66\u544a\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u6267\u884c\u7b56\u7565\u8303\u56f4<\/h3>\n<p>\u60a8\u53ef\u4ee5\u5728 PowerShell \u4e2d\u4e3a\u7279\u5b9a\u8303\u56f4\u8bbe\u7f6e\u6267\u884c\u7b56\u7565\u3002 \u4e94\u4e2a\u6267\u884c\u7b56\u7565\u8303\u56f4\u662f <strong>MachinePolicy, UserPolicy, Process, CurrentUser, <\/strong>\u548c<strong> \u672c\u5730\u673a\u5668<\/strong>.<\/p>\n<p>\u4e0b\u8868\u7b80\u8981\u8bf4\u660e\u4e86\u6240\u6709\u6267\u884c\u7b56\u7565\u8303\u56f4\uff1a<\/p>\n<table border=\"1\" cellspacing=\"1\" cellpadding=\"1\">\n<tbody>\n<tr>\n<td style=\"vertical-align: top;width: 301px;border: 1pxsolidblack\">\u6267\u884c\u7b56\u7565\u8303\u56f4<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: 1pxsolidblack;vertical-align: top;width: 301px\">\u6267\u6cd5<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1pxsolidblack;border-left: 1pxsolidblack;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u7528\u6237\u7b56\u7565<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u7531\u5f53\u524d\u7528\u6237\u7684\u7ec4\u7b56\u7565\u914d\u7f6e\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1pxsolidblack;border-left: 1pxsolidblack;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u673a\u5668\u653f\u7b56<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u7531\u6240\u6709\u7528\u6237\u7684\u7ec4\u7b56\u7565\u914d\u7f6e\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1pxsolidblack;border-left: 1pxsolidblack;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u5f53\u524d\u7528\u6237<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u4e3a\u5f53\u524d\u7528\u6237\u914d\u7f6e\u5e76\u5b58\u50a8\u5728 HKEY_CURRENT_MACHINE \u6ce8\u518c\u8868\u5b50\u9879\u4e2d\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1pxsolidblack;border-left: 1pxsolidblack;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u672c\u5730\u673a\u5668<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u4e3a\u6240\u6709\u7528\u6237\u914d\u7f6e\u5e76\u5b58\u50a8\u5728 HKEY_CURRENT_MACHINE \u6ce8\u518c\u8868\u5b50\u9879\u4e2d\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1pxsolidblack;border-left: 1pxsolidblack;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u8fc7\u7a0b<\/td>\n<td style=\"border-bottom: 1pxsolidblack;border-left: none;border-right: 1pxsolidblack;border-top: none;vertical-align: top;width: 301px\">\u5f71\u54cd\u5f53\u524d\u7684 PowerShell \u4f1a\u8bdd\u5e76\u5728\u4f1a\u8bdd\u5173\u95ed\u65f6\u81ea\u52a8\u5220\u9664\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u5728 Windows \u4e0a\u6dfb\u52a0\u6216\u5220\u9664 PowerShell \u811a\u672c\u6267\u884c\u7b56\u7565<\/h2>\n<p>Windows \u5ba2\u6237\u7aef\u9ed8\u8ba4\u7981\u7528 PowerShell \u4e0a\u7684\u811a\u672c\u6267\u884c\uff0cWindows \u670d\u52a1\u5668\u8bbe\u7f6e\u4e3a RemoteSigned\u3002 \u4f46\u662f\uff0c\u9ad8\u7ea7\u7528\u6237\u53ef\u4ee5\u66f4\u6539\u6267\u884c\u7b56\u7565\u4ee5\u8fd0\u884c\u672c\u5730\u3001\u5df2\u7b7e\u540d\u548c\u672a\u7b7e\u540d\u7684 PowerShell \u811a\u672c\u3002<\/p>\n<p>\u6216\u8005\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u5c06\u811a\u672c\u7c98\u8d34\u5230 PowerShell \u63a7\u5236\u53f0\u6216\u5c06\u60a8\u7684\u811a\u672c\u56de\u663e\u5230 PowerShell \u6807\u51c6\u8f93\u5165\u6765\u7ed5\u8fc7 PowerShell \u6267\u884c\u7b56\u7565\u3002 \u5982\u679c\u60a8\u60f3\u5728\u4e0d\u66f4\u6539\u6267\u884c\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u6267\u884c\u811a\u672c\uff0c\u8fd9\u5c06\u5f88\u6709\u7528\u3002<\/p>\n<h2>\u63a8\u8350\uff1aWooCommerce\u4ed8\u6b3e\u8ba1\u5212\u63d2\u4ef6SUMO WooCommerce Payment<\/h2>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5728Windows PowerShell\u4e2d\u542f\u7528\u548c\u4f7f\u7528\u811a\u672c\u6267\u884c\u7b56\u7565\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cipowershell \u5141\u8bb8\u60a8\u901a\u8fc7\u5176\u63a7\u5236\u53f0\u8fd0\u884c\u547d\u4ee4 (cmdlet)\u3002 \u8981\u6267\u884c\u811a\u672c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u811a\u672c\u4ee3\u7801\u521b\u5efa\u4e00\u4e2a\u8bb0\u4e8b\u672c\u6587\u4ef6\uff0c\u4f7f\u7528 .ps1 \u6587\u4ef6\u6269\u5c55\u540d\u4fdd\u5b58\u5b83\uff0c\u7136\u540e\u901a\u8fc7 powershell \u63a7\u5236\u53f0\u6267\u884c\u5b83\u3002 \u4e5f\u53ef\u4ee5\u76f4\u63a5\u5c06\u811a\u672c\u7c98\u8d34\u5230\u63a7\u5236\u53f0\u6267\u884c\u3002 \u4f46\u662f\uff0c\u5982\u679c\u8fd9\u662f\u60a8\u7b2c\u4e00\u6b21\u901a\u8fc7 PowerShell\u6267\u884c\u811a\u672c\uff0c\u60a8\u4f1a\u9047\u5230\u201c\u6b63\u5728\u8fd0\u884c\u7684\u811a\u672c\u5df2\u88ab\u7981\u7528\u201d\u9519\u8bef\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u7981\u7528 PowerShell \u4e0a\u7684\u811a\u672c\u6267\u884c\u4f5c\u4e3a\u4e00\u9879\u5b89\u5168\u63aa\u65bd\uff0c\u4ee5\u9632\u6b62\u6076\u610f\u811a\u672c\u5728\u60a8\u7684\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002 \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5411\u60a8\u5c55\u793a\u4e86\u5728 Windows PowerShell \u4e0a\u542f\u7528\u811a\u672c\u6267\u884c\u7b56\u7565\u7684\u4e24\u79cd\u65b9\u6cd5\u3002 \u5982\u4f55\u68c0\u67e5\u60a8\u73b0\u6709\u7684\u6267\u884c\u7b56\u7565 \u5b8c\u6210\u540e\uff0c\u6253\u5f00 PowerShell\uff0c\u952e\u5165 get executionpolicy \u6267\u884c\u653f\u7b56\uff0c \u5e76\u6309\u4e0b Enter\u8fdb\u5165. \u5f53\u524d\u7528\u6237\u7684\u6267\u884c\u7b56\u7565\u73b0\u5728\u8bbe\u7f6e\u4e3a RemoteSigned\u8fdc\u7a0b\u7b7e\u540d\u3002 \u5982\u679c\u9700\u8981\u7981\u7528\u6267\u884c\u7b56\u7565\uff0c\u8bf7\u5207\u6362 PowerShell \u5f00\u5173\u5e76\u5c06\u5176\u8bbe\u7f6e\u4e3a Off. \u5982\u4f55\u4f7f\u7528 PowerShell \u5141\u8bb8\u811a\u672c\u5728 PowerShell \u4e2d\u8fd0\u884c \u60a8\u53ef\u4ee5\u4f7f\u7528 PowerShell cmdlet \u5c06\u6267\u884c\u7b56\u7565\u8bbe\u7f6e\u4e3a RemoteSigned\u3002 \u547d\u4ee4\u884c\u754c\u9762\u4f7f\u60a8\u65e0\u9700\u4f7f\u7528\u201c\u8bbe\u7f6e\u201d\u5e94\u7528\u7a0b\u5e8f\u5373\u53ef\u8f7b\u677e\u5feb\u901f\u66f4\u6539\u6267\u884c\u7b56\u7565\u3002 \u6b64\u5916\uff0c\u8bbe\u7f6e\u5e94\u7528\u7a0b\u5e8f\u53ea\u80fd\u542f\u7528\u6216\u7981\u7528 RemoteSigned \u6267\u884c\u7b56\u7565\u3002 \u800c PowerShell \u8fd8\u5141\u8bb8\u60a8\u8bbe\u7f6e\u5176\u4ed6\u7b56\u7565\u548c\u8303\u56f4\u3002 \u8981\u4f7f\u7528 PowerShell \u66f4\u6539\u6267\u884c\u7b56\u7565\uff1a \u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u6253\u5f00 PowerShell\u3002 \u5728 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-38878","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/38878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=38878"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/38878\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=38878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=38878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=38878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}