{"id":55776,"date":"2023-06-26T17:39:15","date_gmt":"2023-06-26T09:39:15","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=55776"},"modified":"2023-06-26T17:39:15","modified_gmt":"2023-06-26T09:39:15","slug":"microsoft-powershell-linux","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/microsoft-powershell-linux.html","title":{"rendered":"PowerShell\u6765\u641e\u4e8b\u60c5\u5566\uff01"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u5728\u5fae\u8f6f\u7231\u4e0aLiunx\u4e4b\u540e\uff0cPowerShell<\/strong> \u8fd9\u4e2a\u539f\u672c\u53ea\u662f Windows \u624d\u80fd\u4f7f\u7528\u7684\u7ec4\u4ef6\uff0c\u4e8e 2016 \u5e74 8 \u6708 18 \u65e5\u5f00\u6e90\u5e76\u4e14\u6210\u4e3a\u8de8\u5e73\u53f0\u8f6f\u4ef6\uff0c\u767b\u9646\u4e86 Linux \u548c macOS\u3002\u672c\u6587\u7ae0\u4e2d\u6211\u4eec\u4e3b\u8981\u5c55\u793a\u4e86\u5982\u4f55\u5728 Linux \u4e2d\u5b89\u88c5\u5fae\u8f6f\u7684 PowerShell Core 6.0<\/strong>\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n PowerShell<\/strong> \u662f\u4e00\u4e2a\u5fae\u8f6f\u5f00\u53d1\u7684\u81ea\u52a8\u5316\u4efb\u52a1\u548c\u914d\u7f6e\u7ba1\u7406\u7cfb\u7edf\u3002\u5b83\u57fa\u4e8e .NET \u6846\u67b6\uff0c\u7531\u547d\u4ee4\u884c\u8bed\u8a00\u89e3\u91ca\u5668\uff08shell\uff09\u548c\u811a\u672c\u8bed\u8a00\u7ec4\u6210\u3002<\/p>\n PowerShell \u63d0\u4f9b\u5bf9 COM\uff08\u7ec4\u4ef6\u5bf9\u8c61\u6a21\u578b\uff09<\/strong>\u00a0\u548c WMI\uff08Windows \u7ba1\u7406\u89c4\u8303\uff09<\/strong>\u7684\u5b8c\u5168\u8bbf\u95ee\uff0c\u4ece\u800c\u5141\u8bb8\u7cfb\u7edf\u7ba1\u7406\u5458\u5728\u672c\u5730\u6216\u8fdc\u7a0b Windows \u7cfb\u7edf\u4e2d \u6267\u884c\u7ba1\u7406\u4efb\u52a1\uff0c\u4ee5\u53ca\u5bf9 WS-Management \u548c CIM\uff08\u516c\u5171\u4fe1\u606f\u6a21\u578b\uff09\u7684\u8bbf\u95ee\uff0c\u5b9e\u73b0\u5bf9\u8fdc\u7a0b Linux \u7cfb\u7edf\u548c\u7f51\u7edc\u8bbe\u5907\u7684\u7ba1\u7406\u3002<\/p>\n \u901a\u8fc7\u8fd9\u4e2a\u6846\u67b6\uff0c\u7ba1\u7406\u4efb\u52a1\u57fa\u672c\u4e0a\u7531\u79f0\u4e3a cmdlets<\/strong>\u7684 .NET<\/strong> \u7c7b\u6267\u884c\u3002\u5c31\u50cf Linux \u7684 shell \u811a\u672c\u4e00\u6837\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u6309\u7167\u4e00\u5b9a\u7684\u89c4\u5219\u5c06\u4e00\u7ec4 cmdlets<\/strong> \u5199\u5165\u6587\u4ef6\u6765\u5236\u4f5c\u811a\u672c\u6216\u53ef\u6267\u884c\u6587\u4ef6\u3002\u8fd9\u4e9b\u811a\u672c\u53ef\u4ee5\u7528\u4f5c\u72ec\u7acb\u7684\u547d\u4ee4\u884c\u7a0b\u5e8f\u6216\u8005\u5de5\u5177\u3002<\/p>\n \u8981\u5728 Linux \u4e2d\u5b89\u88c5 PowerShell Core 6.0<\/strong>\uff0c\u6211\u4eec\u5c06\u4f1a\u7528\u5230\u5fae\u8f6f\u8f6f\u4ef6\u4ed3\u5e93\uff0c\u5b83\u5141\u8bb8\u6211\u4eec\u901a\u8fc7\u6700\u6d41\u884c\u7684 Linux \u5305\u7ba1\u7406\u5668\u5de5\u5177\uff0c\u5982apt-get\u3001yum\u7b49\u6765\u5b89\u88c5\u3002<\/p>\n \u9996\u5148\uff0c\u5bfc\u5165\u8be5\u516c\u5171\u4ed3\u5e93\u7684 GPG<\/strong> \u5bc6\u94a5\uff0c\u7136\u540e\u5c06 Microsoft Ubuntu<\/strong> \u4ed3\u5e93\u6ce8\u518c\u5230 APT<\/strong> \u7684\u6e90\u4e2d\u6765\u5b89\u88c5 PowerShell<\/strong>\uff1a<\/p>\n \u9996\u5148\uff0c\u5c06 Microsoft RedHat<\/strong> \u4ed3\u5e93\u6ce8\u518c\u5230 YUM<\/strong> \u5305\u7ba1\u7406\u5668\u4ed3\u5e93\u5217\u8868\u4e2d\uff0c\u7136\u540e\u5b89\u88c5 PowerShell<\/strong>\uff1a<\/p>\n \u5728\u8fd9\u4e00\u8282\u4e2d\uff0c\u6211\u4eec\u5c06\u4f1a\u7b80\u5355\u4ecb\u7ecd\u4e0b PowerShell<\/strong>\uff1b\u6211\u4eec\u5c06\u4f1a\u770b\u5230\u5982\u4f55\u542f\u52a8 PowerShell\uff0c\u8fd0\u884c\u4e00\u4e9b\u57fa\u7840\u547d\u4ee4\uff0c\u64cd\u4f5c\u6587\u4ef6\u3001\u76ee\u5f55\u548c\u8fdb\u7a0b\u3002\u7136\u540e\u5b66\u4e60\u600e\u6837\u5217\u51fa\u6240\u6709\u53ef\u7528\u7684\u547d\u4ee4\u3001\u663e\u793a\u547d\u4ee4\u5e2e\u52a9\u548c\u522b\u540d\u3002<\/p>\n \u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u542f\u52a8 PowerShell\uff1a<\/p>\n <\/p>\n 1\u3001\u00a0\u53ef\u4ee5\u901a\u8fc7\u4e24\u79cd\u65b9\u6cd5\u521b\u5efa\u7a7a\u6587\u4ef6\uff1a<\/p>\n \u7136\u540e\u5f80\u91cc\u9762\u6dfb\u52a0\u5185\u5bb9\u5e76\u67e5\u770b\u6587\u4ef6\u5185\u5bb9:<\/p>\n 2\u3001\u00a0\u5728 PowerShell \u4e2d\u5220\u9664\u4e00\u4e2a\u6587\u4ef6<\/p>\n 3\u3001\u00a0\u521b\u5efa\u76ee\u5f55:<\/p>\n <\/p>\n 4\u3001\u00a0\u6267\u884c\u957f\u683c\u5f0f\u7684\u5217\u8868\u64cd\u4f5c\uff0c\u5217\u51fa\u6587\u4ef6\uff0f\u76ee\u5f55\u8be6\u7ec6\u60c5\u51b5\uff0c\u5305\u62ec\u6a21\u5f0f\uff08\u6587\u4ef6\u7c7b\u578b\uff09\u3001\u6700\u540e\u4fee\u6539\u65f6\u95f4\u7b49\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n <\/p>\n 5\u3001\u00a0\u663e\u793a\u7cfb\u7edf\u4e2d\u6240\u6709\u7684\u8fdb\u7a0b\uff1a<\/p>\n <\/p>\n 6\u3001\u00a0\u901a\u8fc7\u7ed9\u5b9a\u7684\u540d\u79f0\u67e5\u770b\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\/\u8fdb\u7a0b\u7ec4\u7ec6\u8282\uff0c\u5c06\u8fdb\u7a0b\u540d\u4f5c\u4e3a\u53c2\u6570\u4f20\u7ed9\u4e0a\u9762\u7684\u547d\u4ee4\uff0c\u5982\u4e0b\uff1a<\/p>\n <\/p>\n \u8f93\u51fa\u4e2d\u5404\u90e8\u5206\u7684\u542b\u4e49\uff1a<\/p>\n 7\u3001\u00a0\u60f3\u8981\u4e86\u89e3\u66f4\u591a\uff0c\u83b7\u53d6 PowerShell \u547d\u4ee4\u5217\u8868\uff1a<\/p>\n <\/p>\n 8\u3001\u00a0\u60f3\u77e5\u9053\u5982\u4f55\u4f7f\u7528\u4e00\u4e2a\u547d\u4ee4\uff0c\u67e5\u770b\u5b83\u7684\u5e2e\u52a9\uff08\u7c7b\u4f3c\u4e8e Unix\/Linux \u4e2d\u7684 man\uff09\uff1b\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u4f60\u53ef\u4ee5\u8fd9\u6837\u83b7\u53d6\u547d\u4ee4 Describe<\/strong> \u7684\u5e2e\u52a9\uff1a<\/p>\n <\/p>\n 9\u3001\u00a0\u663e\u793a\u6240\u6709\u547d\u4ee4\u7684\u522b\u540d\uff0c\u8f93\u5165\uff1a<\/p>\n <\/p>\n \u5c31\u662f\u8fd9\u4e9b\u4e86\uff01\u5728\u8fd9\u7bc7\u6587\u7ae0\u91cc\uff0c\u6211\u4eec\u5c55\u793a\u4e86\u5982\u4f55\u5728 Linux \u4e2d\u5b89\u88c5\u5fae\u8f6f\u7684 PowerShell Core 6.0<\/strong>\u3002\u5728\u6211\u770b\u6765\uff0c\u4e0e\u4f20\u7edf Unix\uff0fLinux \u7684 shell \u76f8\u6bd4\uff0cPowerShell \u8fd8\u6709\u5f88\u957f\u7684\u8def\u8981\u8d70\u3002\u76ee\u524d\u770b\u6765\uff0cPowerShell \u8fd8\u9700\u8981\u5728\u547d\u4ee4\u884c\u64cd\u4f5c\u673a\u5668\uff0c\u66f4\u91cd\u8981\u7684\u662f\uff0c\u7f16\u7a0b\uff08\u5199\u811a\u672c\uff09\u7b49\u65b9\u9762\uff0c\u63d0\u4f9b\u66f4\u597d\u3001\u66f4\u591a\u4ee4\u4eba\u6fc0\u52a8\u548c\u5bcc\u6709\u6210\u6548\u7684\u7279\u6027\u3002<\/p>\n \u67e5\u770b PowerShell \u7684 GitHub \u4ed3\u5e93\uff1ahttps:\/\/github.com\/PowerShell\/PowerShell<\/a>\u3002<\/p>\n via: http:\/\/www.tecmint.com\/install-powershell-in-linux\/<\/a><\/p>\n \u4f5c\u8005\uff1aAaron Kili<\/a> \u8bd1\u8005\uff1azijung<\/a> \u6821\u5bf9\uff1ajasminepeng<\/a><\/p>\n \u672c\u6587\u7531 LCTT<\/a> \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n \u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-8296-1.html<\/a><\/p>\n |