{"id":33106,"date":"2010-11-15T17:47:32","date_gmt":"2010-11-15T16:47:32","guid":{"rendered":"https:\/\/www.fuhaijun.com\/?p=33106"},"modified":"2024-11-06T11:22:38","modified_gmt":"2024-11-06T03:22:38","slug":"windows-powershell-2-0%e8%af%ad%e8%a8%80%e7%9a%84%e5%86%85%e7%bd%ae%e7%b1%bb%e5%9e%8b%e7%b3%bb%e7%bb%9f","status":"publish","type":"post","link":"https:\/\/www.fuhaijun.com\/?p=33106","title":{"rendered":"Windows PowerShell 2.0\u8bed\u8a00\u7684\u5185\u7f6e\u7c7b\u578b\u7cfb\u7edf"},"content":{"rendered":"<p>PowerShell\u4e0d\u4ec5\u5141\u8bb8\u7528\u6237\u64cd\u4f5c\u5404\u79cd\u7c7b\u578b\u7684\u5bf9\u8c61\uff0c\u800c\u4e14\u53ef\u4ee5\u901a\u8fc7\u7edf\u4e00\u65b9\u5f0f\u6765\u4fee\u6539\u8fd9\u4e9b\u7c7b\u578b\u3002\u5f53\u7136\u4e5f\u5305\u62ec\u5185\u7f6e\u7c7b\u578b\uff0c\u8fd9\u6837\u53ef\u4ee5\u66f4\u8d34\u8fd1\u65e5\u5e38\u5de5\u4f5c\u4e2d\u7528\u5230\u7684\u5bf9\u8c61\u7c7b\u578b\u3002PowerShell\u7684\u7c7b\u578b\u5728\u5f88\u5927\u7a0b\u5ea6\u4e0a\u4f9d\u9760.NET\u6846\u67b6\uff0c\u5e76\u4e14\u6240\u6709\u5185\u7f6e\u7c7b\u578b\u5373.NET\u7684\u7c7b\u578b\u3002Shell\u7684\u8bbe\u8ba1\u8005\u6269\u5c55\u8fd9\u4e9b\u7c7b\u578b\u5e76\u4e3a\u8bed\u8a00\u6dfb\u52a0\u4e86\u7279\u6b8a\u7684\u8bed\u6cd5\u5feb\u6377\u65b9\u5f0f\u6765\u8ba9\u7528\u6237\u66f4\u65b9\u4fbf\u5730\u4f7f\u7528\u5b83\u4eec\u3002 <\/p>\n<p>1 \u5b57\u7b26\u4e32\u548c\u5b57\u7b26\u4e32\u64cd\u4f5c <\/p>\n<p>\u5b57\u7b26\u4e32\u503c\u5728\u4efb\u4f55\u7f16\u7a0b\u8bed\u8a00\u4e2d\u5747\u4e3a\u5e38\u7528\u6570\u636e\u7c7b\u578b\u4e4b\u4e00\uff0c\u4e3b\u8981\u662f\u56e0\u4e3a\u5b57\u7b26\u4e32\u5305\u542b\u81ea\u7531\u5f62\u6001\u7684\u6570\u636e\uff0c\u800c\u4e14\u7ecf\u5e38\u88ab\u7528\u505a\u7cfb\u7edf\u95f4\u7684\u6570\u636e\u4f20\u8f93\u3002PowerShell\u7684\u5b57\u7b26\u4e32\u5efa\u7acb\u5728.NET\u7684System.String\u5bf9\u8c61\u7c7b\u578b\u4e4b\u4e0a\uff0c\u8fd9\u610f\u5473\u7740\u5b57\u7b26\u4e32\u5305\u542b.NET\u5b57\u7b26\u4e32\u5bf9\u8c61\u7684\u6240\u6709\u64cd\u4f5c\uff1b\u53e6\u5916\u4ee5.NET\u4e3a\u57fa\u7840\uff0c\u5b57\u7b26\u4e32\u5305\u542b\u5f88\u591a\u589e\u52a0\u8868\u73b0\u529b\u548c\u64cd\u4f5c\u80fd\u529b\u7684\u8868\u8fbe\u5f0f\u3002 <\/p>\n<p><b>\u5b57\u7b26\u4e32\u7b80\u5355\u64cd\u4f5c<\/b><\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u5b57\u7b26\u4e32\u53ea\u9700\u8981\u7528\u4e00\u5bf9\u5355\u5f15\u53f7\u2018\u2019\u6216\u8005\u53cc\u5f15\u53f7\u201c\u201d\u62ec\u8d77\u5b57\u7b26\u5e8f\u5217\uff0c\u5982\u4e0b\u4f8b\uff1a <\/p>\n<pre>PS C:\\&gt; 'This is a String'\nThis is a String\nPS C:\\&gt; &quot;This is a String&quot;\nThis is a String<\/pre>\n<p>\u4e24\u79cd\u7c7b\u578b\u7684\u5f15\u53f7\u5141\u8bb8\u5728\u4e0d\u505a\u4efb\u4f55\u8f6c\u4e49\u5904\u7406\u5373\u53ef\u5728\u5b57\u7b26\u4e32\u4e2d\u5305\u542b\u5f15\u53f7\u672c\u8eab\uff0c\u5982\u4e0b\u4f8b\uff1a <\/p>\n<pre>PS C:\\&gt; 'John said :&quot;It is ok!&quot;'\nJohn said :&quot;It is ok!&quot;\nPS C:\\&gt; &quot;Let's go&quot;\nLet's go<\/pre>\n<p>\u5982\u679c\u5b57\u7b26\u4e32\u4e2d\u4f1a\u56e0\u5305\u542b\u590d\u6742\u4e14\u6df7\u5408\u7684\u5f15\u53f7\u800c\u53d8\u5f97\u81c3\u80bf\uff0c\u5219\u53ea\u9700\u8981\u5bf9\u5f15\u53f7\u8fdb\u884c\u8f6c\u4e49\u5904\u7406\uff0c\u5373\u628a\u7b26\u53f7\u91cd\u590d\u4e00\u904d\u5373\u53ef\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;John said:&quot;&quot;OK.&quot;&quot;&quot;\nJohn said:&quot;OK.&quot;\nPS C:\\&gt; 'Let''s go'\nLet's go<\/pre>\n<p>\u53e6\u5916\u4e00\u79cd\u5904\u7406\u5f15\u53f7\u8f6c\u4e49\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u8f6c\u4e49\u5b57\u7b26\u53cd\u5f15\u53f7\u201c`\u201d\uff08\u6ce8\u610f\u4e0d\u5305\u542b\u53cc\u5f15\u53f7\u672c\u8eab\uff0c\u8fd9\u4e2a\u7b26\u53f7\u662f\u5728\u952e\u76d8\u4e0a\u548c~\u5728\u540c\u4e00\u4e2a\u6309\u952e\u4e0a\uff0c\u5728\u82f1\u6587\u4e2d\u88ab\u79f0\u4e3a\u201cbacktick\u6216backquote\u201d\uff09\uff0c\u5982\u4e0b\u4f8b\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;John said:`&quot;OK`&quot;&quot;\nJohn said:&quot;OK&quot;<\/pre>\n<p>\u6ce8\u610f\u53cd\u5f15\u53f7\u7684\u8f6c\u4e49\u4f5c\u7528\u4ec5\u5728\u53cc\u5f15\u53f7\u5b57\u7b26\u4e32\u4e2d\u6709\u6548\uff0c\u901a\u5e38\u7528\u4e8e\u5f88\u96be\u4ece\u952e\u76d8\u8f93\u5165\u7684\u5b57\u7b26\u7684\u8f6c\u4e49\uff0c\u5982\u4ee5\u4e0b\u5b57\u7b26\u3002 <\/p>\n<p>\uff081\uff09`o\uff1a\u901a\u5e38\u88ab\u7528\u505a\u4e00\u4e2a\u5b57\u7b26\u4e32\u7ed3\u675f\u7b26\uff0c\u6b64\u7b26\u53f7\u65e0\u6cd5\u6253\u5370\u7684\u3002 <\/p>\n<p>\uff082\uff09`a\uff1a\u8b66\u544a\u7b26\u53f7\uff0c\u5373ASCII\u7801\u4e3a7\u7684\u5b57\u7b26\u3002\u5728\u5c4f\u5e55\u4e0a\u663e\u793a\u4e00\u4e2a\u5305\u542b\u8fd9\u4e2a\u7b26\u53f7\u7684\u5b57\u7b26\u4e32\u65f6\uff0c\u8ba1\u7b97\u673a\u7684\u5587\u53ed\u5c06\u4f1a\u53d1\u51fa\u201c\u54d4\u54d4\u201d\u7684\u8b66\u544a\uff0c\u6b64\u7b26\u53f7\u65e0\u6cd5\u6253\u5370\u3002\u5305\u542b\u8fd9\u4e2a\u5b57\u7b26\u7684\u5b57\u7b26\u4e32\u793a\u4f8b\u5982\u4e0b\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;John said:`&quot;OK`&quot;`a&quot;\nJohn said:&quot;OK&quot;<\/pre>\n<p>\uff083\uff09`b\uff1a\u9000\u683c\uff08\u540cbackspace\uff09\uff0c\u5220\u9664\u524d\u4e00\u4e2a\u5b57\u7b26\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;aa`b bb&quot;\na bb<\/pre>\n<p>\uff084\uff09`f\uff1a\u6362\u9875\u6216\u5206\u9875\u7b26\uff0c\u6b64\u7b26\u53f7\u5c06\u4f1a\u8ba9\u6253\u5370\u673a\u5728\u65b0\u7684\u4e00\u9875\u4e0a\u5f00\u59cb\u6253\u5370\uff0c\u65e0\u6cd5\u6253\u5370\u3002 <\/p>\n<p>\uff085\uff09`n\uff1a\u6362\u884c\u7b26\uff0c\u4f7f\u6253\u5370\u673a\u6216\u7ec8\u7aef\u5728\u65b0\u7684\u4e00\u884c\u5f00\u59cb\u6253\u5370\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;aa`nbb&quot;\naa\nbb<\/pre>\n<p>\uff086\uff09`r\uff1a\u56de\u8f66\u7b26\uff0c\u4f7f\u6253\u5370\u673a\u6216\u7ec8\u7aef\u5728\u884c\u9996\u5f00\u59cb\u6253\u5370\uff0c\u5b83\u4e0d\u4f1a\u751f\u6210\u65b0\u884c\uff0c\u5e76\u4e14\u540e\u9762\u6253\u5370\u7684\u5b57\u7b26\u5c06\u4f1a\u5728\u5f53\u524d\u884c\u7684\u5f00\u59cb\u5904\u6253\u5370\uff0c\u6240\u4ee5\u53ef\u80fd\u4f1a\u8986\u76d6\u4e4b\u524d\u7684\u8f93\u51fa\u3002\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u8be5\u7b26\u53f7\u7ecf\u5e38\u914d\u5408`n\u6765\u5728\u6587\u672c\u6587\u4ef6\u4e2d\u5f00\u59cb\u4e00\u4e2a\u65b0\u884c\u3002`r`n\u7ec4\u5408\u5c06\u4f1a\u751f\u6210\u4e00\u4e2a\u65b0\u884c\u3002 <\/p>\n<p>\uff087\uff09`t\uff1a\u6c34\u5e73\u5236\u8868\u7b26\uff0c\u6839\u636e\u5f53\u524d\u63a7\u5236\u53f0\u7684\u914d\u7f6e\u5411\u524d\u79fb\u52a8\u51e0\u4e2a\u5b57\u7b26\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;aa`tbb&quot;\naa      bb<\/pre>\n<p>\uff088\uff09`v\uff1a\u5782\u76f4\u5236\u8868\u7b26\uff0c\u82f1\u8bed\u6253\u5370\u6216\u8005\u683c\u5f0f\u5316\u63a7\u5236\u53f0\u8f93\u51fa\u3002 <\/p>\n<p>\u5728\u63a7\u5236\u53f0\u6253\u5370\u65f6\uff0c\u53cd\u5f15\u53f7\u5f88\u6709\u7528\uff0c\u53ef\u4ee5\u5c06\u5176\u4f5c\u4e3a\u4e00\u4e2a\u65b0\u884c\u7684\u8f6c\u4e49\u5b57\u7b26\u3002\u5982\u679c\u5728\u547d\u4ee4\u7684\u884c\u672b\u6dfb\u52a0\u4e00\u4e2a\u53cd\u5f15\u53f7\uff0c\u5bf9\u4e8eShell\uff0c\u547d\u4ee4\u5c06\u4f1a\u5728\u4e0b\u4e00\u884c\u7ee7\u7eed\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; Get-Item C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\types.ps1xml `\n&gt;&gt; |Get-Content |Measure-Object\n&gt;&gt;\n\nCount    : 3187\nAverage  :\nSum      :\nMaximum  :\nMinimum  :\nProperty :<\/pre>\n<p><b>\u63d2\u5165\u5b57\u7b26\u4e32<\/b><\/p>\n<p>\u5728\u5f88\u591a\u811a\u672c\u548cShell\u8bed\u8a00\u4e2d\u5b57\u7b26\u4e32\u53ef\u4f5c\u4e3a\u53d8\u91cf\u66ff\u6362\u63d2\u5165\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u7279\u6027\uff0cShell\u5c06\u4f1a\u5c55\u5f00\u8fd9\u4e9b\u53d8\u91cf\uff0c\u5e76\u7528\u5176\u503c\u6765\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u53d8\u91cf\u3002\u4f7f\u7528\u8fd9\u4e2a\u7279\u6027\u6765\u683c\u5f0f\u5316\u8f93\u51fa\uff0c\u4ee5\u5728\u5c06\u5176\u5728\u4f20\u9012\u5230\u5176\u4ed6\u7a0b\u5e8f\u4e4b\u524d\u683c\u5f0f\u5316\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $processCount=(Get-Process).Count\nPS C:\\&gt; &quot;$processCount Porcesses Running in the system.&quot;\n44 Porcesses Running in the system.<\/pre>\n<p>\u5982\u679c\u4e0d\u9700\u8981\u5c06\u7f8e\u5143\u7b26\u8868\u8fbe\u5f0f\u4f5c\u4e3a\u53d8\u91cf\u540d\uff0c\u5219\u4f7f\u7528\u53cd\u5f15\u53f7\u8f6c\u4e49\u7f8e\u5143\u7b26\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;`$processCount is the property that we need.&quot;\n$processCount is the property that we need.<\/pre>\n<p>\u53e6\u5916\u4e00\u79cd\u65b9\u6cd5\u662f\u7528\u5355\u5f15\u53f7\u5b57\u7b26\u4e32\u6765\u4ee3\u66ff\uff0c\u53d8\u91cf\u63d2\u5165\u529f\u80fd\u4ec5\u5728\u53cc\u5f15\u53f7\u5b57\u7b26\u4e32\u4e2d\u6709\u6548\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; '$processCount is the property that we need.'\n$processCount is the property that we need.<\/pre>\n<p>\u5b57\u7b26\u4e32\u63d2\u5165\u529f\u80fd\u7684\u793a\u4f8b\u5982\u4e0b\uff1a <\/p>\n<pre>PS C:\\&gt; @&quot;\n&gt;&gt; Processes\n&gt;&gt; ------------\n&gt;&gt; $processCount\n&gt;&gt; &quot;@\n&gt;&gt;\nProcesses\n------------\n44<\/pre>\n<p>\u53ef\u4ee5\u7c7b\u63a8\u5230\u5355\u5f15\u53f7\u5b57\u7b26\u4e32\uff0c\u8fd9\u91cc\u4f7f\u7528\u5355\u5f15\u53f7\u5b57\u7b26\u4e32\u65f6\u5b57\u7b26\u4e32\u63d2\u5165\u529f\u80fd\u65e0\u6548\u3002\u5728\u5b57\u7b26\u4e32\u4e2d\u53ef\u4ee5\u4f7f\u7528\u590d\u6742\u7684\u53d8\u91cf\u8868\u8fbe\u5f0f\uff0c\u4f46\u662f\u5fc5\u987b\u4e25\u683c\u9075\u5faa\u683c\u5f0f\u5316\u89c4\u5219\uff0c\u53d8\u91cf\u5206\u89e3\u4f1a\u5728\u7b2c1\u4e2a\u5355\u8bcd\u7ed3\u675f\u3002\u4f7f\u7528\u4e00\u4e2a\u590d\u6742\u8868\u8fbe\u5f0f\u65f6\uff0c\u9700\u8981\u5c06\u5176\u653e\u5728$()\u4ee3\u7801\u5757\u4e2d\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;$($process.Count) process running in the system.&quot;\n44 process running in the system.<\/pre>\n<p>\u5982\u679c\u5728\u4e0a\u4f8b\u4e2d\u672a\u6dfb\u52a0$()\uff0c\u5373\u4ec5\u4ec5\u4ee5$process.Count\u53d8\u91cf\u548c\u5b57\u7b26\u4e32\u7684\u7ec4\u5408\u8f93\u51fa\uff0c\u5219\u7ed3\u679c\u662f$process\u3002\u4e4b\u524d\u4e3a\u8fd9\u4e2a\u53d8\u91cf\u8d4b\u503c\u4e3aGet-Process\uff0c\u5373\u5f53\u524d\u8fd0\u884c\u7a0b\u5e8f\u3002\u8f93\u51fa\u662f\u8fd9\u4e9b\u8fd0\u884c\u7a0b\u5e8f\u7684\u6e05\u5355\uff0c\u5e76\u4e0d\u662f\u76ee\u6807\u4e2d\u9700\u8981\u7684\u8fd0\u884c\u7a0b\u5e8f\u7684\u6570\u76ee\u3002 <\/p>\n<p>\u6ce8\u610f\u53d8\u91cf\u5728$()\u5757\u4e2d\u4ecd\u7136\u9700\u8981\u6dfb\u52a0\u7f8e\u5143\u7b26\u7684\u524d\u7f00\uff0c\u4e0b\u4f8b\u8bd5\u56fe\u5b8c\u5168\u6446\u8131$process\u53d8\u91cf\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;$($process.Count) process running in the system.&quot;\n44 process running in the system.<\/pre>\n<p>\u5728\u5b57\u7b26\u4e32\u4e2d\u53ef\u4ee5\u5d4c\u5165\u4efb\u4f55\u5408\u6cd5\u7684PowerShell\u8868\u8fbe\u5f0f\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;Total due:$(12 * 5000)&quot;\nTotal due:60000<\/pre>\n<p>\u751a\u81f3\u53ef\u4ee5\u7528\u5d4c\u5165\u7684\u8868\u8fbe\u5f0f\u6765\u52a8\u6001\u6539\u53d8\u4e00\u4e2a\u53d8\u91cf\u6765\u8f93\u51fa\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $times=0\nPS C:\\&gt; &quot;Operation performed $($times++;$times++;$times) times&quot;\nOperation performed 2 times\nPS C:\\&gt; $times\n2<\/pre>\n<p>\u5728\u8868\u8fbe\u5f0f$($times++;$times++;$times)\u4e2d\u5148\u540e\u4e24\u6b21\u4f7f\u7528\u81ea\u589e\u8fd0\u7b97\u7b26\u6539\u53d8$times\u53d8\u91cf\u503c\uff0c\u8868\u8fbe\u5f0f\u7684\u503c\u76f8\u5f53\u4e8e\u6267\u884c\u524d\u4e24\u4e2a\u64cd\u4f5c\u540e\u7684$times\u503c\u3002<\/p>\n<p><b>\u901a\u914d\u7b26\u5339\u914d<\/b><\/p>\n<p>\u901a\u914d\u7b26\u5339\u914d\u548c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u7c7b\u4f3c\uff0c\u53ea\u662f\u4e0d\u9700\u8981\u4efb\u4f55\u5f3a\u5927\u7684\u5185\u7f6e\u6b63\u5219\u8868\u8fbe\u5f0f\u3002\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\u81ea\u52a8\u4e14\u4fbf\u4e8e\u4f7f\u7528\uff0c\u5982\u4e0b\u4f8b\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;Test string&quot; -like &quot;Test*&quot;\nTrue\nPS C:\\&gt; &quot;Simple string&quot; -like &quot;Test*&quot;\nFalse<\/pre>\n<p>\u5176\u4e2d\u7684\u661f\u53f7\u4ee3\u8868\u96f6\u5230\u591a\u4e2a\u4efb\u610f\u5b57\u7b26\uff0c\u53ef\u4ee5\u7528\u95ee\u53f7\u6765\u7cbe\u786e\u5339\u914d\u5355\u4e2a\u5b57\u7b26\uff0c\u5982\u4e0b\u4f8b\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;notepad.exe&quot; -like &quot;notepad.???&quot;\nTrue\nPS C:\\&gt; &quot;notepad.exe&quot; -like &quot;notepad.?&quot;\nFalse\nPS C:\\&gt; &quot;notepad.exe&quot; -like &quot;notepad.??&quot;\nFalse\nPS C:\\&gt; &quot;notepad.exe&quot; -like &quot;?otepad.exe&quot;\nTrue<\/pre>\n<p>\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5b57\u7b26\u4e32\u5e8f\u5217\uff0c\u4e0b\u4f8b\u68c0\u6d4b\u5b57\u7b26\u4e32\u662f\u5426\u4ee5\u4efb\u610f\u5b57\u6bcd\u5f00\u5934\u5e76\u4ee5\u201cs\u201d\u6216\u201cn\u201d\u7ed3\u675f\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;notepads&quot; -like &quot;[a-z]*[sn]&quot;\nTrue\nPS C:\\&gt; &quot;notepadz&quot; -like &quot;[a-z]*[sn]&quot;\nFalse\nPS C:\\&gt; &quot;-notepads&quot; -like &quot;[a-z]*[sn]&quot;\nFalse<\/pre>\n<p><b>\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d<\/b><\/p>\n<p>\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u4e0e\u901a\u914d\u7b26\u5339\u914d\u7c7b\u4f3c\uff0c\u533a\u522b\u662f\u4f7f\u7528-match\u64cd\u4f5c\u7b26\u5e76\u63d0\u4f9b\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u53c2\u6570\u3002\u4e0b\u4f8b\u8bf4\u660e\u5982\u4f55\u6765\u5339\u914d\u7c7b\u4f3c\u57df\u540d\u7684\u5b57\u7b26\u4e32\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;www.baidu.com&quot; -match &quot;(www\\.)?\\w+\\.(com|org|net|cn)&quot;\nTrue\nPS C:\\&gt; &quot;baidu.com&quot; -match &quot;(www\\.)?\\w+\\.(com|org|net|cn)&quot;\nTrue\nPS C:\\&gt; &quot;baidu.cn&quot; -match &quot;(www\\.)?\\w+\\.(com|org|net|cn)&quot;\nTrue<\/pre>\n<p>\u8868\u8fbe\u5f0f\u7684\u5b57\u7b26\u4e32\u7279\u5f81\u4e3a\u4ee5\u201cwww.\u201d\u5f00\u5934\uff0c\u5176\u540e\u4e3a\u4e00\u4e2a\u6216\u8005\u591a\u4e2a\u5b57\u6bcd\u6570\u5b57\u3001\u4e00\u4e2a\u70b9\uff08.\uff09\uff0c\u4ee5\u53ca\u201ccom\u201d\u3001\u201corg\u201d\u3001\u201cnet\u201d\u6216\u8005\u201ccn\u201d\u3002\u6ce8\u610f\u70b9\uff08.\uff09\u5728\u6b63\u5219\u8868\u8fbe\u5f0f\u4e2d\u6709\u7279\u6b8a\u4f5c\u7528\uff0c\u5b83\u4ee3\u8868\u4efb\u4f55\u5b57\u7b26\uff0c\u6240\u4ee5\u4f7f\u7528\u4e00\u4e2a\u53cd\u659c\u6760\uff08\\\uff09\u5bf9\u5176\u8fdb\u884c\u8f6c\u4e49\u3002 <\/p>\n<p>\u3010\u63d0\u793a\u3011 <\/p>\n<p>\u5173\u4e8e\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u66f4\u591a\u4fe1\u606f\u53ef\u4ee5\u8bbf\u95eehttp:\/\/www.regular-expressions.info\uff0c\u5176\u4e2d\u6db5\u76d6\u4e86\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u4e0d\u540c\u7f16\u7a0b\u8bed\u8a00\u548c\u73af\u5883\u3002\u5728\u4e0d\u540c\u7684\u5e73\u53f0\u4e0a\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u8bed\u6cd5\u6216\u591a\u6216\u5c11\u4f1a\u6709\u4e9b\u76f8\u4f3c\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u4e00\u4e9b\u5f88\u5fae\u5999\u7684\u5dee\u5f02\uff0c\u8bf7\u8bfb\u8005\u52a1\u5fc5\u6ce8\u610f\u3002\u6240\u6d4f\u89c8\u5230\u7684\u6587\u7ae0\u662f\u5173\u4e8e.NET\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\uff0c\u7edd\u5927\u591a\u6570\u5173\u4e8e.NET\u7684\u6587\u7ae0\u96c6\u4e2d\u5728<a href=\"http:\/\/www.regular-expressions.info\/dotnet.html\">http:\/\/www.regular-expressions.info\/dotnet.html<\/a>\u4e2d\u3002PowerShell\u4f7f\u7528.NET\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u8bf7\u52a1\u5fc5\u7559\u610f\u3002<\/p>\n<p><b>\u66ff\u6362\u5b57\u7b26\u4e32\u6216\u5b50\u5b57\u7b26\u4e32<\/b><\/p>\n<p>PowerShell\u63d0\u4f9b\u4e86-replace\u64cd\u4f5c\u7b26\u66ff\u6362\u51fa\u73b0\u7684\u5b57\u7b26\u4e32\uff0c.NET\u4e2d\u7684String.Replace()\u65b9\u6cd5\u5c06\u5b57\u7b26\u4e32\u4f5c\u4e3a\u4e00\u4e2a\u53c2\u6570\uff0c\u66ff\u6362\u51fa\u73b0\u7684\u76ee\u6807\u5b57\u7b26\u4e32\u7684\u60c5\u51b5\u3002\u5982\u4e0b\u4f8b\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;one.test,two!test&quot;.Replace(&quot;.test&quot;,&quot;--&gt;DONE&quot;)\none--&gt;DONE,two!test<\/pre>\n<p>-replace\u5e26\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u5e76\u4e14\u5728\u5176\u4e2d\u8c03\u7528Regex.Replace()\u3002\u6ce8\u610f\u5728\u66ff\u4ee3\u6a21\u5f0f\u4e0b\uff0c\u6839\u636e\u4e0d\u540c\u60c5\u51b5\u9700\u8981\u8f6c\u4e49\u6b63\u5219\u8868\u8fbe\u5f0f\u4e2d\u7684\u7279\u6b8a\u5b57\u7b26\u3002\u5728\u4e0b\u4f8b\u4e2d\u7684-replace\u5e76\u6ca1\u6709\u8fbe\u5230\u9884\u671f\u7684\u76ee\u7684\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;one.test,two!test&quot; -replace &quot;.test&quot;,&quot;--&gt;DONE&quot;\none--&gt;DONE,two--&gt;DONE<\/pre>\n<p>\u8fd9\u662f\u56e0\u4e3a\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u70b9\uff08.\uff09\u4f5c\u4e3a\u7528\u4e8e\u5339\u914d\u4efb\u610f\u4e00\u4e2a\u5b57\u7b26\uff0c\u6240\u4ee5\u5b57\u7b26\u4e32\u4e2d\u7684\u611f\u53f9\u53f7\u88ab\u66ff\u6362\u3002\u4e3a\u4e86\u6539\u6b63\u8fd9\u4e2a\u9519\u8bef\uff0c\u6211\u4eec\u9700\u8981\u5bf9\u70b9\u8f6c\u4e49\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;one.test,two!test&quot; -replace &quot;\\.test&quot;,&quot;--&gt;DONE&quot;\none--&gt;DONE,two!test<\/pre>\n<p><b>\u6570\u5b57\u7c7b\u578b<\/b><\/p>\n<p>PowerShell\u652f\u6301\u6240\u6709.NET\u5185\u7f6e\u7684\u6570\u5b57\u7c7b\u578b\uff0c\u4e3a\u65b9\u4fbf\u8bfb\u8005\u7406\u89e3\uff0c\u5728\u63cf\u8ff0\u65f6\u4e0eC\u8bed\u8a00\u76f8\u5bf9\u6bd4\u3002 <\/p>\n<p><b>\u6574\u578b<\/b><\/p>\n<p>System.Int32\u5982\u540cC\u8bed\u8a00\u4e2d\u7684int\u7c7b\u578b\uff0c\u662f\u4e00\u4e2a32\u4f4d\u6574\u578b\u6570\u503c\uff0c\u521b\u5efa\u65b9\u6cd5\u662f\u952e\u5165\u4e00\u4e2a\u963f\u62c9\u4f2f\u6570\u5b57\uff1a <\/p>\n<pre>PS C:\\&gt; (3).GetType().FullName\nSystem.Int32<\/pre>\n<p><b>\u6d6e\u70b9\u6570<\/b><\/p>\n<p>\u5355\u7cbe\u5ea6\u548c\u53cc\u7cbe\u5ea6\u7684\u6d6e\u70b9\u6570\u5bf9\u5e94\u4e8eC\u8bed\u8a00\u4e2d\u7684single\u6216float\uff0c\u4ee5\u53cadouble\uff0c\u5e38\u7528\u7684\u7c7b\u578b\u662fdouble\uff0c\u901a\u8fc7\u4f7f\u7528\u76f8\u5e94\u7684\u6570\u5b57\u5e8f\u5217\u6765\u5b9e\u73b0\uff1a <\/p>\n<pre>PS C:\\&gt; (3.0).GetType().FullName\nSystem.Double\nPS C:\\&gt; (-3E2).GetType().FullName\nSystem.Double\nPS C:\\&gt; (4.5E-2).GetType().FullName\nSystem.Double<\/pre>\n<p>\u9700\u8981\u6ce8\u610f\u79d1\u5b66\u8ba1\u6570\u6cd5\u9700\u8981\u6307\u5b9a\u5c3e\u6570\u548c\u6307\u6570\u3002 <\/p>\n<p><b>\u5341\u8fdb\u5236\u6570<\/b><\/p>\n<p>System.Decimal\u5bf9\u5e94\u4e8e\u5341\u8fdb\u5236\u6570\uff0c\u521b\u5efa\u5341\u8fdb\u5236\u6570\u636e\u9700\u8981\u5728\u6570\u5b57\u540e\u9762\u6dfb\u52a0d\u7684\u540e\u7f00\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; 2d\n2\nPS C:\\&gt; 2.5d\n2.5\nPS C:\\&gt; 2.5d * 10000000000000000000000\n25000000000000000000000.0<\/pre>\n<p><b>\u5341\u516d\u8fdb\u5236\u6570<\/b><\/p>\n<p>\u521b\u5efa\u5341\u516d\u8fdb\u5236\u6570\u9700\u8981\u6dfb\u52a0\u524d\u7f000x\u4e0e\u5176\u4ed6\u8fdb\u5236\u7684\u6570\u5b57\u533a\u522b\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; 0x10\n16\nPS C:\\&gt; 0xABCDEF\n11259375<\/pre>\n<p>PowerShell\u589e\u52a0\u4e86\u8fdb\u5236\u4e58\u6cd5\u5668\u540e\u7f00\uff0c\u80fd\u591f\u901a\u8fc7\u5728\u6570\u5b57\u540e\u6dfb\u52a0KB\u3001MB\u53caGB\u6765\u5206\u522b\u5f97\u52301 024\u30011 048 576\u548c1 073 741 824\u7684\u4e58\u79ef\u3002\u4e0b\u4f8b\u83b7\u53d6\u8fd0\u884c\u4e2d\u7a0b\u5e8f\u7684\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\uff1a <\/p>\n<pre>PS C:\\&gt; Get-Process winword\n\nHandles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName\n-------  ------    -----      ----- -----   ------     -- -----------\n    509      24    55328     119452   653   568.67   6124 WINWORD\n\nPS C:\\&gt; (Get-Process winword).VM -ge 650MB\nTrue\nPS C:\\&gt; (Get-Process winword).VM -ge 654MB\nFalse\nPS C:\\&gt; (Get-Process winword).VM -ge 653MB\nFalse\nPS C:\\&gt; (Get-Process winword).VM \/ 1MB\n652.7890625<\/pre>\n<p>winword\u5360\u7528\u7684\u5185\u5b58\u5927\u7ea6\u662f653 MB\u3002\u4ee5650 MB\u63a2\u6d4b\uff0c\u7ed3\u679c\u4e3aTrue\uff08\u771f\uff09\uff1b\u7528654 MB\u548c653 MB\u6765\u63a2\u6d4b\uff0c\u8fd4\u56deFalse\uff08\u5047\uff09\u3002\u7528\u83b7\u53d6\u7684\u5185\u5b58\u503c\u9664\u4ee51 MB\uff0c\u7ed3\u679c\u503c\u4ecb\u4e8e652 MB\u548c653 MB\u4e4b\u95f4\u3002\u4e5f\u53ef\u4ee5\u7528\u7c7b\u4f3c\u7684\u65b9\u6cd5\u6765\u83b7\u5f97\u8ba1\u7b97\u673a\u4e2d\u7684\u6587\u4ef6\u548c\u5bf9\u8c61\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; (Get-Item F:\\pagefile.sys -Force).Length \/ 1GB\n1.998046875<\/pre>\n<p>Pagefile.sys\u662f\u4e2a\u7cfb\u7edf\u6587\u4ef6\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\u4e0d\u5141\u8bb8\u4e00\u822c\u8fdb\u7a0b\u8bbf\u95ee\u3002\u6240\u4ee5\u6211\u4eec\u4f7f\u7528-Force\u53c2\u6570\u6765\u5f3a\u884c\u8bbf\u95ee\u5b83\uff0c\u8fd9\u6837\u7684\u8bbf\u95ee\u662f\u5b89\u5168\u4e14\u88ab\u5141\u8bb8\u7684\u3002 <\/p>\n<p><b>\u5b57\u7b26\u4e32\u7c7b\u578b\u7684\u6570\u5b57<\/b><\/p>\n<p>\u5c06\u6570\u5b57\u7c7b\u578b\u683c\u5f0f\u5316\u5e76\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u7c7b\u578b\u4f7f\u7528-f\u5b57\u7b26\u4e32\u64cd\u4f5c\u7b26\uff0c\u5176\u4e2d\u7279\u522b\u7684\u683c\u5f0f\u5316\u9009\u9879\u5982\u4e0b\u3002 <\/p>\n<p>\uff081\uff09\u8d27\u5e01\uff1a\u4f7f\u7528{0:c}\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u4f1a\u6839\u636e\u5f53\u524d\u7cfb\u7edf\u7684\u533a\u57df\u548c\u8bed\u8a00\u8bbe\u7f6e\u5728\u6570\u503c\u524d\u9762\u589e\u52a0\u76f8\u5e94\u7684\u5e01\u7b26\u6807\u5fd7\uff0c\u4e0b\u4f8b\u4e2d\u7b2c1\u4e2a\u8bed\u53e5\u662f\u6839\u636e\u5f53\u524d\u8ba1\u7b97\u673a\u9ed8\u8ba4\u7cfb\u7edf\u8bed\u8a00\u4e3a\u201c\u4e2d\u6587\uff08\u4e2d\u56fd\uff09\u201d\u7684\u60c5\u51b5\u4e0b\u683c\u5f0f\u5316\u6570\u503c\u7684\u8f93\u51fa\uff1b\u7b2c2\u4e2a\u8bed\u53e5\u662f\u5c06\u7cfb\u7edf\u8bed\u8a00\u6539\u4e3a\u201c\u82f1\u8bed\uff08\u7f8e\u56fd\uff09\u201d\u540e\u7684\u8f93\u51fa\uff0cPowerShell\u8bfb\u53d6\u7cfb\u7edf\u4e2d\u7684\u914d\u7f6e\u6765\u6839\u636e\u5bf9\u5e94\u8f93\u51fa\u76f8\u5e94\u7684\u5e01\u7b26\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;{0:c}&quot; -f 2.5\n\uffe52.50\nPS C:\\&gt; &quot;{0:c}&quot; -f 2.5\n$2.50<\/pre>\n<p>\uff082\uff09\u767e\u5206\u6bd4\uff1a\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u4e3a{0:p}\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;{0:p}&quot; -f 0.2\n20.00%<\/pre>\n<p>\uff083\uff09\u4fee\u6b63\u4fdd\u7559\u5c0f\u6570\u4f4d\uff1a\u7528\u4e95\u53f7#\u6765\u4f5c\u4e3a\u6570\u5b57\u5360\u4f4d\u7b26\uff0c\u4e0b\u4f8b\u5728\u5c0f\u6570\u70b9\u540e\u9762\u4fdd\u75593\u4f4d\u6709\u6548\u6570\u5b57\uff0c\u5176\u4e2d\u91c7\u7528\u56db\u820d\u4e94\u5165\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;{0:#.###}&quot; -f 3.4567\n3.457\nPS C:\\&gt; &quot;{0:#.###}&quot; -f 3.4564\n3.456<\/pre>\n<p>\uff084\uff09\u79d1\u5b66\u8ba1\u6570\u6cd5\uff1a\u683c\u5f0f\u5316\u5b57\u7b26\u4e32{0:e}\u89c4\u683c\u5316\u4e00\u4e2a\u5e95\u6570\u5e76\u5f97\u5230\u5e42\u6307\u6570\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5e95\u6570\u603b\u4f1a\u4fdd\u7559\u5c0f\u6570\u70b9\u540e6\u4f4d\u3002\u800c\u4e14\u6700\u540e\u4e00\u4f4d\u4e0d\u56db\u820d\u4e94\u5165\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; &quot;{0:e}&quot; -f 0.000333456789123456\n3.334568e-004\nPS C:\\&gt; &quot;{0:e}&quot; -f 333.456789\n3.334568e+002\nPS C:\\&gt; &quot;{0:e}&quot; -f 33345.6789\n3.334568e+004\nPS C:\\&gt; &quot;{0:e}&quot; -f 33345678.9\n3.334568e+007\nPS C:\\&gt; &quot;{0:e}&quot; -f 333456789123456\n3.334568e+014<\/pre>\n<p>\u5176\u4ed6\u5728.NET\u4e2d\u7684\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u8fd8\u6709\u5f88\u591a\uff0c\u5177\u4f53\u60c5\u51b5\u8bf7\u53c2\u9605MSDN\u4e2d\u7684System.Globalization.NumberFormatInfo\u7c7b\u6587\u6863\u3002 <\/p>\n<p>\u7ec6\u5fc3\u7684\u8bfb\u8005\u5e94\u8be5\u80fd\u591f\u770b\u5230\uff0c\u5728\u4e0d\u77e5\u9053PowerShell\u8bed\u8a00\u7684\u5177\u4f53\u7ec6\u8282\u7279\u70b9\u7684\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u7528\u4e86\u4e00\u4e9b\u65b9\u6cd5\u6765\u83b7\u53d6\u4e00\u4e9b\u4fe1\u606f\uff0c\u5373\u5b8c\u5168\u628aPowerShell\u5b8c\u5168\u5f53\u4f5c\u4e00\u4e2a\u9ed1\u76d2\u5b50\uff0c\u9760\u6784\u9020\u7684\u7279\u6b8a\u8f93\u5165\u83b7\u5f97\u4e00\u4e9b\u76f8\u5173\u7684\u4fe1\u606f\u3002\u5b66\u4e60\u4e00\u79cd\u8bed\u8a00\uff0c\u66f4\u591a\u7684\u65f6\u5019\u9700\u8981\u9760\u81ea\u5df1\u7684\u7ec6\u5fc3\u6765\u83b7\u5f97\u4e00\u4e9b\u8bbe\u8ba1\u8005\u5728\u8bbe\u8ba1\u8bed\u8a00\u65f6\u7684\u5de7\u5999\u60f3\u6cd5\u3002 <\/p>\n<p><b>\u6570\u7ec4\u4e0e\u96c6\u5408<\/b><\/p>\n<p>\u5728\u7f16\u7a0b\u4e2d\u6570\u7ec4\u548c\u5176\u4ed6\u5e8f\u5217\u5316\u7684\u96c6\u5408\u8d77\u7740\u91cd\u8981\u7684\u4f5c\u7528\uff0c\u672c\u8282\u4ea4\u66ff\u4f7f\u7528\u201c\u6570\u7ec4\u201d\u548c\u201c\u6709\u5e8f\u96c6\u5408\u201d\u6765\u8bb2\u89e3PowerShell\u9002\u914d\u5668\u5de5\u4f5c\u673a\u5236\u4e2d\u7c7b\u4f3c\u7684\u5e8f\u5217\u5316\u96c6\u5408\u3002 <\/p>\n<p>\u4e3a\u521b\u5efa\u6570\u7ec4\uff0c\u7f57\u5217\u5176\u6240\u6709\u7684\u5143\u7d20\u5e76\u7528\u9017\u53f7\u5206\u9694\uff0c\u5982\u4e0b\u4f8b\uff1a <\/p>\n<pre>PS C:\\&gt; 1,2,3,4,5\n1\n2\n3\n4\n5\nPS C:\\&gt; (1,2,3,4,5).GetType().FullName\nSystem.Object[]<\/pre>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u4e00\u70b9\u662f\u6570\u7ec4\u662fObject\u7c7b\u578b\uff0c\u8fd9\u610f\u5473\u7740\u80fd\u591f\u64cd\u4f5c\u5176\u4e2d\u7684\u5bf9\u8c61\uff0c\u5982\u4e0b\u4f8b\uff1a <\/p>\n<pre>PS C:\\&gt; 1,2.5,&quot;Apples&quot;,(Get-Process winword)\n1\n2.5\nApples\n\nHandles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName\n-------  ------    -----      ----- -----   ------     -- -----------\n    369      14    15008      11788   384     2.31   1120 WINWORD\n    524      25    62500     128564   558   747.91   6124 WINWORD\n\nPS C:\\&gt; (1,2.5,&quot;Apples&quot;,(Get-Process winword)).Count\n4<\/pre>\n<p>\u4e0a\u8ff0\u4ee3\u7801\u521b\u5efa\u4e86\u4e00\u4e2a\u5305\u542b\u6574\u6570\u3001double\u7cbe\u5ea6\u7684\u6d6e\u70b9\u6570\u3001\u5b57\u7b26\u4e32\u53caProcess\u5bf9\u8c61\u7684\u5bf9\u8c61\u6570\u7ec4\uff0c\u8fd94\u79cd\u7c7b\u578b\u7684\u5bf9\u8c61\u7efc\u5408\u8d77\u6765\u5c31\u662f\u4e00\u4e2aint\u3001double\u3001string\u548cSystem.Diagnostics.Process\u5b9e\u4f8b\u3002 <\/p>\n<p>\u521b\u5efa\u6570\u7ec4\u7684\u5e38\u89c1\u8bed\u6cd5\u662f\u628a\u6210\u5458\u5bf9\u8c61\u5305\u542b\u5728@()\u5757\u4e2d\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; @(&quot;one&quot;,&quot;two&quot;)\none\ntwo<\/pre>\n<p>\u4e0b\u9762\u7684\u65b9\u6cd5\u662f\u521b\u5efa\u7a7a\u6570\u7ec4\u7684\u552f\u4e00\u65b9\u5f0f\uff1a <\/p>\n<pre>PS C:\\&gt; (@()).Count\n0\nPS C:\\&gt; (@()).GetType().FullName\nSystem.Object[]<\/pre>\n<p>\u53ef\u4ee5\u901a\u8fc7\u8d77\u59cb\u548c\u7ed3\u675f\u6570\u5b57\u7684\u6570\u503c\u533a\u95f4\u5e8f\u5217\u6765\u5efa\u7acb\u6570\u7ec4\uff0c\u7a0b\u5e8f\u81ea\u52a8\u586b\u5145\u5269\u4f59\u7684\u6570\u503c\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; 5..1\n5\n4\n3\n2\n1\nPS C:\\&gt; 1..5\n1\n2\n3\n4\n5\nPS C:\\&gt; (0..255).Count\n256<\/pre>\n<p>\u8fd9\u79cd\u8bed\u6cd5\u7ed3\u6784\u5bf9\u4e8e\u5217\u4e3e\u7aef\u53e3\u3001\u5730\u5740\u548c\u5404\u79cd\u7c7b\u578b\u7684\u6709\u5e8f\u5e8f\u5217\u5f88\u6709\u7528\u3002\u521b\u5efa\u7684\u6570\u7ec4\u8bed\u6cd5\u53ef\u4ee5\u8bc6\u522b\u5d4c\u5957\u7684\u6570\u7ec4\u8bed\u6cd5\u5e76\u4e14\u5c06\u5176\u8f6c\u6362\u4e3a\u4e00\u4e2a\u5bf9\u8c61\uff0c\u8fd9\u6837\u5141\u8bb8\u5728\u5408\u9002\u7684\u4f4d\u7f6e\u6dfb\u52a0\u6570\u7ec4\u548c\u5e8f\u5217\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; 1,(5..7),2\n1\n5\n6\n7\n2\nPS C:\\&gt; 1,(10..7),2\n1\n10\n9\n8\n7\n2<\/pre>\n<p>\u53ef\u4ee5\u4f7f\u7528\u65b9\u62ec\u53f7[]\u6765\u8bbf\u95ee\u6570\u7ec4\u5143\u7d20\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $a=2,3,4\nPS C:\\&gt; $a[1]\n3\nPS C:\\&gt; $a=2,3,4\nPS C:\\&gt; $a[0]\n2\nPS C:\\&gt; $a[1]\n3\nPS C:\\&gt; $a[2]=5\nPS C:\\&gt; $a[2]\n5<\/pre>\n<p>\u6ce8\u610f\u53ef\u4ee5\u901a\u8fc7\u76f4\u63a5\u4e3a\u5176\u8d4b\u503c\u6765\u4fee\u6539\u6570\u7ec4\u5143\u7d20\u3002\u6570\u7ec4\u4e0b\u6807\u4ece0\u5f00\u59cb\u7f16\u53f7\uff0c\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u7684\u7f16\u53f7\u662f\u6570\u7ec4\u5927\u5c0f\u51cf1\u3002 <\/p>\n<p>\u53ef\u4ee5\u5728\u65b9\u62ec\u53f7\u4e2d\u4f20\u9012\u591a\u4e2a\u7f16\u53f7\uff0c\u8fd4\u56de\u503c\u662f\u5305\u542b\u8fd9\u4e9b\u7f16\u53f7\u5bf9\u5e94\u7684\u6570\u7ec4\u5143\u7d20\uff0c\u79f0\u4e3a\u201c\u6570\u7ec4\u7247\u6bb5\u201d\u3002\u4e0b\u4f8b\u83b7\u53d6\u6570\u7ec4\u7684\u7b2c1\u4e2a\u548c\u6700\u540e\u4e00\u4e2a\u5143\u7d20\uff1a <\/p>\n<pre>PS C:\\&gt; $a=2,3,4\nPS C:\\&gt; $a[0,2]\n2\n4<\/pre>\n<p>\u4e0a\u4f8b\u7684\u95ee\u9898\u662f\u9700\u8981\u77e5\u9053\u6570\u7ec4\u67093\u4e2a\u5143\u7d20\uff0c\u6240\u4ee5\u8981\u83b7\u53d6\u7f16\u53f7\u4e3a2\u7684\u5143\u7d20\u3002PowerShell\u5141\u8bb8\u4ece\u7ed3\u5c3e\u5f00\u59cb\u4ee5\u8d1f\u6570\u7f16\u53f7\u6765\u5b9a\u4f4d\u5143\u7d20\uff0c\u8fd9\u6837\u5728\u4e0a\u4f8b\u4e2d\u53ef\u4ee5\u4e0d\u7528\u6307\u5b9a\u6570\u7ec4\u957f\u5ea6\u7684\u5927\u5c0f\u800c\u5b9a\u4f4d\u6700\u540e\u4e00\u4e2a\u5143\u7d20\uff1a <\/p>\n<pre>PS C:\\&gt; $a=2,3,4\nPS C:\\&gt; $a[0,-1]\n2\n4<\/pre>\n<p>\u540c\u6837\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f20\u9012\u7d22\u5f15\u503c\u7684\u8303\u56f4\u6765\u521b\u5efa\u6570\u7ec4\u7247\u6bb5\uff0c\u4e0b\u4f8b\u4ece\u7b2c3\u4e2a\u5143\u7d20\u5f00\u59cb\u53d6\u5f975\u4e2a\u5143\u7d20\uff1a <\/p>\n<pre>PS C:\\&gt; $a=(1,2,3,4,5,6,7,8)\nPS C:\\&gt; $a[2..6]\n3\n4\n5\n6\n7<\/pre>\n<p>\u628a\u6570\u7ec4A\u8d4b\u503c\u7ed9\u6570\u7ec4B\u7684\u5143\u7d20\u5c06\u4f1a\u6269\u5927\u6570\u7ec4B\uff0c\u8fd9\u662f\u5728\u7279\u5b9a\u4f4d\u7f6e\u63d2\u5165\u591a\u4e2a\u5143\u7d20\u7684\u7b80\u4fbf\u65b9\u6cd5\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $a=1,2,3\nPS C:\\&gt; $a[1]=10,20,30\nPS C:\\&gt; $a\n1\n10\n20\n30\n3<\/pre>\n<p>\u6570\u7ec4\u5bf9\u8c61\u4e5f\u53ef\u7528\u52a0\u8fd0\u7b97\u7b26\u4e32\u8054\uff0c\u5c06\u4e00\u4e2a\u5bf9\u8c61\u6216\u8005\u6570\u7ec4\u201c\u52a0\u5728\u201d\u6570\u7ec4\u4e0a\u5c06\u4f1a\u8fd4\u56de\u5305\u542b\u6240\u6709\u5bf9\u8c61\u7684\u4e00\u4e2a\u65b0\u7684\u6570\u7ec4\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $a=1,2\nPS C:\\&gt; $a=$a+3\nPS C:\\&gt; $a\n1\n2\n3<\/pre>\n<p>\u4e0a\u4f8b\u5728\u53d8\u91cf\u4e2d\u589e\u52a0\u4e00\u4e2a\u5143\u7d20\u3002PowerShell\u652f\u6301\u5feb\u6377\u64cd\u4f5c\u7b26\u201c+=\u201d\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $a+=4\nPS C:\\&gt; $a\n1\n2\n3\n4\nPS C:\\&gt; $a+=5,6\nPS C:\\&gt; $a\n1\n2\n3\n4\n5\n6<\/pre>\n<p>\u4e0b\u4f8b\u4ece\u5bf9\u8c61\u96c6\u4e2d\u641c\u7d22\u5143\u7d20\uff1a <\/p>\n<pre>foreach($item in (1,2,3,4)){if($item -eq 3){echo &quot;Found&quot;}}<\/pre>\n<p>\u8be5\u4f8b\u5728\u4ece\u6570\u7ec4\u5143\u7d20\u4e2d\u67e5\u627e\u65f6\u91cd\u590d\u76f8\u540c\u7684\u5faa\u73af\uff0c\u66f4\u7b80\u4fbf\u7684\u65b9\u6cd5\u662f\u4f7f\u7528PowerShell\u63d0\u4f9b\u4e24\u4e2a\u7279\u5b9a\u64cd\u4f5c\u7b26-contains\u548c-notcontains\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; (2,3,4) -contains 3\nTrue\nPS C:\\&gt; (2,3,4) -notcontains 3\nFalse\nPS C:\\&gt; (2,3,4) -notcontains 5\nTrue<\/pre>\n<p>\u8fd9\u4e9b\u64cd\u4f5c\u7b26\u4e5f\u53ef\u4ee5\u7528\u5728\u4e0d\u540c\u7684\u53d8\u91cf\u7c7b\u578b\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; (2,&quot;some value&quot;,4) -contains &quot;some value&quot;\nTrue\nPS C:\\&gt; (2,&quot;some value&quot;,4) -contains &quot;Some valuE&quot;\nTrue<\/pre>\n<p>\u4ece\u4e0a\u4f8b\u4e2d\u53ef\u4ee5\u770b\u5230\u5339\u914d\u5bf9\u5927\u5c0f\u5199\u4e0d\u654f\u611f\u3002<\/p>\n<p>\u8981\u5c0f\u5fc3\u5730\u8f6c\u6362\u5185\u7f6e\u7c7b\u578b\uff0c\u56e0\u4e3a\u53ef\u80fd\u4f1a\u5f97\u5230\u5b8c\u5168\u4e0d\u540c\u7684\u7ed3\u679c\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; (2,3,4) -contains &quot;3&quot;\nTrue\nPS C:\\&gt; (2,3,4) -contains &quot;3.0&quot;\nTrue<\/pre>\n<p>\u5982\u679c\u9700\u8981\u67e5\u627e\u5b57\u7b26\u4e32\u5e76\u907f\u514d\u7c7b\u578b\u5e26\u6765\u7684\u5f71\u54cd\uff0c\u5219\u9700\u8981\u4f7f\u7528\u5faa\u73af\u6216Where-Object\u547d\u4ee4\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; (2,3,4)| Where-Object{$_ -is [string] -and $_ -eq &quot;3.0&quot;}\nPS C:\\&gt; (2,&quot;3.0&quot;,4)| Where-Object{$_ -is [string] -and $_ -eq &quot;3.0&quot;}\n3.0<\/pre>\n<p><b>\u5b57\u5178\u548c\u54c8\u5e0c\u8868<\/b><\/p>\n<p>\u5b57\u5178\u4e5f\u88ab\u79f0\u4e3a\u201c\u8054\u5408\u6570\u7ec4\u201d\uff0c\u662f\u4e00\u79cd\u5e8f\u5217\u5b57\u6bb5\u6620\u5c04\u5230\u5e8f\u5217\u503c\u7684\u5bf9\u8c61\uff0c\u5176\u4e2d\u5305\u542b\u5927\u91cf\u952e-\u503c\u7ec4\u5408\u5bf9\u5e76\u5141\u8bb8\u5feb\u901f\u901a\u8fc7\u952e\u67e5\u627e\u5230\u503c\u3002\u5b57\u5178\u662f\u4e2a\u5b58\u50a8\u7740\u5305\u542b\u73b0\u5b9e\u4e16\u754c\u903b\u8f91\u8bb0\u5f55\u76f8\u5173\u6570\u636e\u7684\u5b9e\u4f53\u3002\u5728PowerShell\u4e2d\u521b\u5efa\u5b57\u5178\u7684\u8bed\u6cd5\u7ed3\u6784\u548c\u521b\u5efa\u6570\u7ec4\u7c7b\u4f3c\uff0c\u4e0d\u540c\u4e4b\u5904\u662f\u4f7f\u7528\u5206\u53f7\u548c\u82b1\u62ec\u53f7\u7684\u7ec4\u5408\u6765\u5206\u9694\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u521b\u5efa\u4e2a\u4eba\u8bb0\u5f55\u5b57\u5178\u7684\u5b9e\u4f8b\uff0c\u5176\u4e2d\u7684\u4e24\u4e2a\u952e\u5143\u7d20\u5206\u522b\u662f\u201cName\u201d\u548c\u201cAddress\u201d\uff1a <\/p>\n<pre>PS C:\\&gt; $d=@{&quot;Name&quot;=&quot;John&quot;;&quot;Address&quot;=&quot;12 Easy St.&quot;}\nPS C:\\&gt; $d\n\nName                           Value\n----                           -----\nName                           John\nAddress                        12 Easy St.<\/pre>\n<p>\u5728\u5efa\u7acb\u5b57\u5178\u5bf9\u8c61\u65f6\uff0cPowerShell\u901a\u8fc7\u8c03\u7528System,Collection.Hashtable\u5bf9\u8c61\u6765\u5b9e\u73b0\u3002\u54c8\u5e0c\u8868\u6267\u884c.NET\u4e2d\u7684IDictionary\u63a5\u53e3\uff0cPowerShell\u7684\u6269\u5c55\u7c7b\u578b\u7cfb\u7edf\u5141\u8bb8\u4f7f\u7528\u4e0e\u6240\u6709IDictionary\u5bf9\u8c61\u4e00\u6837\u7684\u65b9\u5f0f\u6765\u5de5\u4f5c\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $d.GetType().FullName\nSystem.Collections.Hashtable<\/pre>\n<p>\u5b57\u5178\u6ca1\u6709\u9650\u5236\u5bf9\u8c61\u7c7b\u578b\uff0c\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u952e\u548c\u503c\uff0c\u4e0b\u4f8b\u6dfb\u52a0\u4e0d\u540c\u7684\u5bf9\u8c61\u5230\u54c8\u5e0c\u8868\u4e2d\uff1a <\/p>\n<pre>PS C:\\&gt; $d=@{&quot;Name&quot;=&quot;John&quot;;&quot;Age&quot;=30`\n&gt;&gt; ;&quot;File&quot;=(Get-Item C:\\PowerShell\\Test.txt)}\n&gt;&gt;\nPS C:\\&gt; $d\n\nName                           Value\n----                           -----\nName                           John\nAge                            30\nFile                           C:\\PowerShell\\Test.txt<\/pre>\n<p>$d\u4e2d\u5305\u542b\u5b57\u7b26\u4e32\u3001\u6574\u578b\u548cFileInfo\u5bf9\u8c61\u3002\u4e8b\u5b9e\u4e0a\uff0c\u5e76\u6ca1\u6709\u9650\u5236\u53ea\u6709\u5b57\u7b26\u4e32\u624d\u80fd\u4f5c\u4e3a\u5b57\u5178\u7684\u952e\u3002\u53ef\u4ee5\u4f7f\u7528\u7cfb\u7edf\u7684\u8ba1\u7b97\u5668\u548cWord\u6765\u521b\u5efa\u4e00\u4e2aProcess\u5bf9\u8c61\u96c6\uff0c\u5e76\u6620\u5c04\u5230\u5bf9\u5e94\u7684\u5b57\u7b26\u4e32\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $set = @{(Get-Process Winword)=&quot;MS Word&quot;;(Get-Process calc)=&quot;calc&quot;}\nPS C:\\&gt; $set\n\nName                           Value\n----                           -----\nSystem.Diagnostics.Process ... MS Word\nSystem.Diagnostics.Process ... calc<\/pre>\n<p>\u53ef\u4ee5\u7528@{}\u8868\u8fbe\u5f0f\u6765\u521b\u5efa\u7a7a\u5b57\u5178\uff1a <\/p>\n<pre>PS C:\\&gt; $empty=@{}\nPS C:\\&gt; $empty.GetType().FullName\nSystem.Collections.Hashtable<\/pre>\n<p>\u8bbf\u95ee\u5b57\u5178\u503c\u7684\u91cd\u8981\u65b9\u6cd5\u662f\u7528\u65b9\u62ec\u53f7\u62ec\u8d77\u7684\u952e\u540d\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $d=@{&quot;Name&quot;=&quot;John&quot;;&quot;Age&quot;=30;&quot;Address&quot;=&quot;12 Easy St.&quot;}\nPS C:\\&gt; $d[&quot;Name&quot;]\nJohn<\/pre>\n<p>\u5b57\u5178\u53ef\u4ee5\u4f5c\u4e3a\u5bf9\u8c61\u6765\u8bbf\u95ee\u5b50\u5bf9\u8c61\uff0c\u4f7f\u7528\u70b9\u5206\u9694\u7b26\u8bbf\u95ee\u5176\u503c\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $d=@{&quot;Name&quot;=&quot;John&quot;;&quot;Age&quot;=30;&quot;Address&quot;=&quot;12 Easy St.&quot;}\nPS C:\\&gt; $d.Name\nJohn<\/pre>\n<p>\u5b57\u5178\u5bf9\u8c61\u652f\u6301\u591a\u79cd\u65b9\u5f0f\u6765\u8bbf\u95ee\u952e\u503c\uff0c\u5982\u4f7f\u7528\u53d8\u91cf\u4f5c\u4e3a\u952e\uff1a <\/p>\n<pre>PS C:\\&gt; $property=&quot;Name&quot;\nPS C:\\&gt; $d.$property\nJohn<\/pre>\n<p>\u751a\u81f3\u662f\u4e00\u4e2a\u8868\u8fbe\u5f0f\uff1a <\/p>\n<pre>PS C:\\&gt; $d.$($property)\nJohn\nPS C:\\&gt; $d.$(&quot;Na&quot; + &quot;me&quot;)\nJohn<\/pre>\n<p>\u5b57\u5178\u652f\u6301\u5728\u65b9\u62ec\u53f7\u4e2d\u653e\u7f6e\u591a\u4e2a\u952e\u540d\uff0c\u8fd4\u56de\u7684\u5bf9\u8c61\u4e3a\u5305\u542b\u503c\u7684\u6570\u7ec4\u3002\u4e0b\u4f8b\u4ece\u4e4b\u524d\u5efa\u7acb\u7684\u5b57\u5178\u4e2d\u83b7\u53d6\u4eba\u540d\u548c\u4f4f\u5740\uff1a <\/p>\n<pre>PS C:\\&gt; $d=@{&quot;Name&quot;=&quot;John&quot;;&quot;Age&quot;=30;&quot;Address&quot;=&quot;12 Easy St.&quot;}\nPS C:\\&gt; $d[&quot;Name&quot;,&quot;Address&quot;]\nJohn\n12 Easy St.<\/pre>\n<p>\u4e3a\u5b57\u5178\u6dfb\u52a0\u5143\u7d20\u4ec5\u4ec5\u6dfb\u52a0\u4e86\u952e-\u503c\u5bf9\uff0c\u800c\u4e0d\u6dfb\u52a0\u5bf9\u8c61\u6216\u8005\u6570\u7ec4\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $d.Department=&quot;Accounting&quot;\nPS C:\\&gt; $d[&quot;NO.&quot;]=123456789\nPS C:\\&gt; $d\n\nName                           Value\n----                           -----\nDepartment                     Accounting\nName                           John\nAge                            30\nAddress                        12 Easy St.\nNO.                            123456789<\/pre>\n<p>\u5982\u679c\u8981\u79fb\u9664\u4e00\u4e2a\u5143\u7d20\uff0c\u4f7f\u7528Remove()\u65b9\u6cd5\u5e76\u63d0\u4f9b\u952e\u540d\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $d.Remove(&quot;Age&quot;)\nPS C:\\&gt; $d.Remove(&quot;NO.&quot;)\nPS C:\\&gt; $d\n\nName                           Value\n----                           -----\nDepartment                     Accounting\nName                           John\nAddress                        12 Easy St.<\/pre>\n<p>Contains()\u548cContainsKey()\u65b9\u6cd5\u7528\u6765\u5b57\u5178\u4e2d\u662f\u5426\u5b58\u5728\u7ed9\u5b9a\u7684\u952e\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $d.Contains(&quot;John&quot;)\nFalse\nPS C:\\&gt; $d.Contains(&quot;Name&quot;)\nTrue\nPS C:\\&gt; $d.ContainsKey(&quot;Name&quot;)\nTrue<\/pre>\n<p>ContainValue()\u662f\u7528\u6765\u67e5\u627e\u4e00\u4e2a\u952e\u503c\u662f\u5426\u5b58\u5728\uff1a <\/p>\n<pre>PS C:\\&gt; $d.ContainsValue(&quot;Name&quot;)\nFalse\nPS C:\\&gt; $d.ContainsValue(&quot;John&quot;)\nTrue<\/pre>\n<p>\u53e6\u5916\uff0c\u5b57\u5178\u5bf9\u8c61\u4f7f\u7528Keys\u548cValues\u5c5e\u6027\u6765\u5411\u5916\u5c55\u793a\u952e\u540d\u548c\u952e\u503c\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $d.Key\nPS C:\\&gt; $d.Keys\nDepartment\nName\nAddress\nNO.\nPS C:\\&gt; $d.Values\nAccounting\nJohn\n12 Easy St.\n123456789<\/pre>\n<p>\u53ef\u4ee5\u4f7f\u7528\u6570\u7ec4\u68c0\u7d22\u6765\u66ff\u4ee3\u8c03\u7528ContainsKey()\u548cContainsValue()\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $d.Keys -contains &quot;Name&quot;\nTrue\nPS C:\\&gt; $d.Values -contains &quot;John&quot;\nTrue<\/pre>\n<p>\u9700\u8981\u8bb0\u4f4f\u7684\u662f-contains\u4f1a\u5728\u540e\u53f0\u81ea\u52a8\u6267\u884c\u7c7b\u578b\u8f6c\u6362\uff0c\u800cContainsKey()\u548cContainsValue()\u4e0d\u4f1a\u3002 <\/p>\n<p>\u7c7b\u4f3c\u4e8e.NET\u5bf9\u8c61\u96c6\uff0c\u5b57\u5178\u7684Count\u5c5e\u6027\u5305\u62ec\u5185\u90e8\u5b58\u653e\u7684\u952e-\u503c\u5bf9\u7684\u6570\u91cf\uff0c\u5982\uff1a <\/p>\n<pre>PS C:\\&gt; $d=@{&quot;Name&quot;=&quot;John&quot;;&quot;Age&quot;=30;&quot;Address&quot;=&quot;12 Easy St.&quot;}\nPS C:\\&gt; $d.Count\n3<\/pre>\n<p><b>\u603b \u7ed3<\/b><\/p>\n<p>PowerShell\u4f5c\u4e3a\u5f3a\u5927\u4e14\u590d\u6742\u7684\u8bed\u8a00\uff0c\u5e76\u6ca1\u6709\u8fc7\u4e8e\u4e25\u683c\u6216\u5bf9\u65b0\u624b\u4e0d\u53cb\u597d\u3002\u56e0\u4e3a\u5b83\u628a\u6240\u6709\u7684\u5bf9\u8c61\u7c7b\u578b\u901a\u8fc7\u9002\u914d\u5668\u548c\u6269\u5c55\u7edf\u4e00\u5b58\u53d6\uff0c\u6240\u4ee5\u7528\u6237\u80fd\u591f\u627e\u5230\u5feb\u901f\u5165\u624b\u7684\u9014\u5f84\u3002\u6700\u5e38\u7528\u7684\u5bf9\u8c61\u662f\u83b7\u53d6\u5b9e\u4f53\u6269\u5c55\uff0c\u4ece\u800c\u63d0\u9ad8\u4e86\u811a\u672c\u7f16\u5199\u8005\u7684\u521b\u9020\u6027\uff0c\u5e76\u964d\u4f4e\u4e86\u5b66\u4e60\u7684\u96be\u5ea6\u3002\u672c\u6587\u9488\u5bf9PowerShell\u5e38\u89c1\u7684\u5b57\u7b26\u4e32\u3001\u6570\u5b57\u3001\u6570\u7ec4\u3001\u96c6\u5408\u3001\u5b57\u5178\u548c\u54c8\u5e0c\u8868\u7b49\u5185\u7f6e\u7c7b\u578b\u8fdb\u884c\u4ecb\u7ecd\uff0c\u5e76\u5bf9\u5176\u5e38\u89c1\u7684\u64cd\u4f5c\u8fdb\u884c\u63cf\u8ff0\uff0c\u4fbf\u4e8e\u8bfb\u8005\u7684\u7406\u89e3\u548c\u638c\u63e1\u3002<\/p>\n<p>\u8d5b\u8fea\u7f51\u5730\u5740\uff1a<a title=\"http:\/\/news.ccidnet.com\/art\/32857\/20100608\/2081077_1.html\" href=\"http:\/\/news.ccidnet.com\/art\/32857\/20100608\/2081077_1.html\">http:\/\/news.ccidnet.com\/art\/32857\/20100608\/2081077_1.html<\/a><\/p>\n<p>\u4f5c\u8005: \u4ed8\u6d77\u519b<br \/>\n  <br \/>\u7248\u6743\uff1a\u672c\u6587\u7248\u6743\u5f52\u4f5c\u8005\u6240\u6709<\/p>\n<p>\u8f6c\u8f7d\uff1a\u6b22\u8fce\u8f6c\u8f7d\uff0c\u4e3a\u4e86\u4fdd\u5b58\u4f5c\u8005\u7684\u521b\u4f5c\u70ed\u60c5\uff0c\u8bf7\u6309\u8981\u6c42\u3010\u8f6c\u8f7d\u3011\uff0c\u8c22\u8c22<\/p>\n<p>\u8981\u6c42\uff1a\u672a\u7ecf\u4f5c\u8005\u540c\u610f\uff0c\u5fc5\u987b\u4fdd\u7559\u6b64\u6bb5\u58f0\u660e\uff1b\u5fc5\u987b\u5728\u6587\u7ae0\u4e2d\u7ed9\u51fa\u539f\u6587\u8fde\u63a5\uff1b\u5426\u5219\u5fc5\u7a76\u6cd5\u5f8b\u8d23\u4efb <\/p>\n<p>\u4e2a\u4eba\u7f51\u7ad9: http:\/\/txj.shell.tor.hu<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell\u4e0d\u4ec5\u5141\u8bb8\u7528\u6237\u64cd\u4f5c\u5404\u79cd\u7c7b\u578b\u7684\u5bf9\u8c61\uff0c\u800c\u4e14\u53ef\u4ee5\u901a\u8fc7\u7edf\u4e00\u65b9\u5f0f\u6765\u4fee\u6539\u8fd9\u4e9b\u7c7b\u578b\u3002\u5f53\u7136\u4e5f\u5305\u62ec\u5185\u7f6e\u7c7b\u578b\uff0c\u8fd9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-33106","post","type-post","status-publish","format-standard","hentry","category-powershell"],"_links":{"self":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/posts\/33106"}],"collection":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=33106"}],"version-history":[{"count":1,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/posts\/33106\/revisions"}],"predecessor-version":[{"id":33810,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/posts\/33106\/revisions\/33810"}],"wp:attachment":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}