{"id":33102,"date":"2010-11-15T05:42:59","date_gmt":"2010-11-15T04:42:59","guid":{"rendered":"https:\/\/www.fuhaijun.com\/?p=33102"},"modified":"2024-11-06T11:22:38","modified_gmt":"2024-11-06T03:22:38","slug":"windows-powershell-2-0%e8%af%ad%e8%a8%80%e5%af%b9%e8%b1%a1%e4%b8%8e%e5%af%b9%e8%b1%a1%e7%b1%bb%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/www.fuhaijun.com\/?p=33102","title":{"rendered":"Windows PowerShell 2.0\u8bed\u8a00\u5bf9\u8c61\u4e0e\u5bf9\u8c61\u7c7b\u578b"},"content":{"rendered":"<p>PowerShell\u4e2d\u9075\u5faa\u7684\u4e00\u5207\u90fd\u662f\u5bf9\u8c61\uff0c\u5177\u6709\u4e00\u4e9b\u4e13\u5c5e\u7684\u7279\u6027\uff0c\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u5c5e\u6027\u6765\u533a\u522b\u5b83\u4eec\u3002\u7531\u4e8eWindows\u548cUnix\/Linux\u4e4b\u95f4\u6709\u672c\u8d28\u533a\u522b\uff0c\u56e0\u6b64\u5728Windows\u4e2d\u8981\u5b9e\u73b0\u5f3a\u5927\u7684Shell\u5916\u58f3\u4e0d\u80fd\u9075\u5faaUnix\/Linux\u7684\u6280\u672f\u8def\u7ebf\u3002\u800c\u7528\u5bf9\u8c61\u6765\u64cd\u4f5cWindows\u65e0\u7591\u662f\u6700\u597d\u7684\u9009\u62e9\uff0c\u5bf9\u8c61\u53ef\u4ee5\u6709\u4e0d\u540c\u7684\u7c7b\u578b\u548c\u539f\u578b\uff0c\u5e76\u4e14\u53ef\u4ee5\u5b58\u50a8\u4e0d\u540c\u7684\u6570\u636e\u3002\u5bf9\u8c61\u7684\u9996\u8981\u7684\u5c5e\u6027\u662f\u5176\u7c7b\u578b\uff0c\u7c7b\u578b\u5305\u542b\u5bf9\u8c61\u652f\u6301\u7684\u64cd\u4f5c\u3002\u5bf9\u4e8e.NET\u7c7b\uff0c\u53ef\u4ee5\u4f7f\u7528\u6240\u6709.NET\u5bf9\u8c61\u652f\u6301\u7684Type()\u65b9\u6cd5\u6765\u83b7\u53d6\u5bf9\u8c61\u7684\u7c7b\u578b\uff0c\u5982\u4e0b\u4f8b\u6240\u793a\uff1a<\/p>\n<p>PS C:\\&gt; (42).GetType()<\/p>\n<p>IsPublic IsSerial Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; BaseType<\/p>\n<p>&#8212;&#8212;&#8211; &#8212;&#8212;&#8211; &#8212;-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8212;&#8211;<\/p>\n<p>True&#160;&#160;&#160;&#160; True&#160;&#160;&#160;&#160; Int32&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.ValueType<\/p>\n<p>PS C:\\&gt; &quot;Hello World!&quot;.GetType()<\/p>\n<p>IsPublic IsSerial Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; BaseType<\/p>\n<p>&#8212;&#8212;&#8211; &#8212;&#8212;&#8211; &#8212;-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8212;&#8211;<\/p>\n<p>True&#160;&#160;&#160;&#160; True&#160;&#160;&#160;&#160; String&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.Object<\/p>\n<p>PS C:\\&gt; (1,2,3).GetType()<\/p>\n<p>IsPublic IsSerial Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; BaseType<\/p>\n<p>&#8212;&#8212;&#8211; &#8212;&#8212;&#8211; &#8212;-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8212;&#8211;<\/p>\n<p>True&#160;&#160;&#160;&#160; True&#160;&#160;&#160;&#160; Object[]&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.Array<\/p>\n<p><strong>\u8bbf\u95ee\u5bf9\u8c61\u5c5e\u6027<\/strong><\/p>\n<p>\u4e00\u4e2a\u5bf9\u8c61\u7c7b\u578b\u5305\u542b\u5bf9\u8c61\u6210\u5458\uff0c\u6210\u5458\u5177\u6709\u5e38\u7528\u5c5e\u6027\u548c\u65b9\u6cd5\uff0c\u53ef\u4ee5\u662f\u8f93\u5165\u57df\u6216\u4e8b\u4ef6\u3002\u5c5e\u6027\u901a\u5e38\u7528\u6765\u5411\u5916\u754c\u5c55\u793a\u5bf9\u8c61\u7684\u6570\u636e\uff0c\u6570\u636e\u901a\u5e38\u5b58\u653e\u5728\u4e00\u4e2a\u5c5e\u6027\u4e2d\uff0c\u800c\u8fd9\u4e2a\u5c5e\u6027\u53c8\u4ee5\u4e00\u4e2a\u5bf9\u8c61\u7684\u5f62\u5f0f\u5b58\u5728\u3002\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u7b26\u53f7\u6765\u8bbf\u95ee\u5c5e\u6027\u503c\uff1a<\/p>\n<p>PS C:\\&gt; $User=@{}<\/p>\n<p>PS C:\\&gt; $User.Name=&quot;\u5c0f\u80d6&quot;<\/p>\n<p>PS C:\\&gt; $User.Name<\/p>\n<p>\u5c0f\u80d6<\/p>\n<p>\u4e0a\u4f8b\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5b57\u5178\u5bf9\u8c61\u5e76\u5c06\u5176\u5b58\u50a8\u5728$User\u53d8\u91cf\u4e2d\uff0c\u7136\u540e\u5c06\u201c\u5c0f\u80d6\u201d\u8fd9\u4e2a\u5b57\u7b26\u4e32\u8d4b\u503c\u7ed9Name\u5c5e\u6027\uff0c\u6700\u540e\u4e00\u884c\u53d6\u51fa\u5c5e\u6027\u503c\u3002<\/p>\n<p>\u5c5e\u6027\u53ef\u4ee5\u662f\u53ea\u8bfb\u6216\u8005\u53ef\u8bfb\u5199\u7684\uff0c\u8fd9\u53d6\u51b3\u4e8e\u5176\u503c\u662f\u5426\u53ef\u4ee5\u4fee\u6539\u3002\u5982\u679c\u4e3a\u4e00\u4e2a\u53ea\u8bfb\u5c5e\u6027\u6267\u884c\u8d4b\u503c\u64cd\u4f5c\uff0cShell\u5916\u58f3\u5c06\u4f1a\u62a5\u9519\uff1a<\/p>\n<p>PS C:\\&gt; &quot;Hello&quot;.length=7<\/p>\n<p>&quot;Length&quot; is a ReadOnly property.<\/p>\n<p>At line:1 char:9<\/p>\n<p>+ &quot;Hello&quot;. &lt;&lt;&lt;&lt; length=7<\/p>\n<p>String\u5bf9\u8c61\u662f\u4e0d\u53ef\u53d8\u5bf9\u8c61\uff0c\u5176\u5c5e\u6027length\u662f\u5b57\u7b26\u4e32\u5bf9\u8c61\u672c\u8eab\u56fa\u6709\u7684\u5c5e\u6027\uff0c\u4e0d\u80fd\u901a\u8fc7\u4e3a\u5176\u8d4b\u503c\u6765\u6539\u53d8\u3002<\/p>\n<p>\u8bb8\u591a\u5bf9\u8c61\u5305\u542b\u79f0\u4e3a\u201c\u7d22\u5f15\u503c\u201d\u7684\u7279\u6b8a\u5c5e\u6027\uff0c\u8fd9\u79cd\u5c5e\u6027\u516c\u5f00\u5bf9\u8c61\u5e8f\u5217\u5e76\u5141\u8bb8\u901a\u8fc7\u4e00\u4e2a\u540d\u79f0\u6216\u7d22\u5f15\u6765\u8bbf\u95ee\uff0c\u5373\u901a\u5e38\u4f7f\u7528\u7684\u6570\u7ec4\u3002\u4f8b\u5982\uff1a<\/p>\n<p>PS C:\\&gt; $friuit=&quot;apples&quot;,&quot;banana&quot;,&quot;orange&quot;<\/p>\n<p>PS C:\\&gt; $friuit[0]<\/p>\n<p>apples<\/p>\n<p>PS C:\\&gt; $friuit[2]<\/p>\n<p>Orange<\/p>\n<p>\u6570\u7ec4\u4e0b\u6807\u4ece0\u5f00\u59cb\u7f16\u53f7\uff0c\u6700\u5927\u503c\u4e3a\u6570\u7ec4\u957f\u5ea6\u503c-1\u3002<\/p>\n<p><strong>\u4f7f\u7528\u5bf9\u8c61\u65b9\u6cd5<\/strong><\/p>\n<p>\u5bf9\u8c61\u65b9\u6cd5\u662f\u63cf\u8ff0\u5bf9\u8c61\u652f\u6301\u64cd\u4f5c\u7684\u811a\u672c\u5757\uff0c\u901a\u5e38\u643a\u5e26\u53c2\u6570\u5e76\u8fd4\u56de\u5176\u4ed6\u5bf9\u8c61\u3002\u5982\u4e0b\u4f8b\u67e5\u627e\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u5305\u542b\u53e6\u5916\u4e00\u4e2a\u5b57\u7b26\u4e32\uff1a<\/p>\n<p>PS C:\\&gt; &quot;Hello&quot;.Contains(&quot;Hell&quot;)<\/p>\n<p>True<\/p>\n<p>\u65b9\u6cd5\u4e5f\u53ef\u4e0d\u5e26\u53c2\u6570\uff0c\u4e0b\u4f8b\u7528ToUpper\u65b9\u6cd5\u5c06\u5b57\u7b26\u4e32\u5bf9\u8c61\u8f6c\u6362\u4e3a\u5927\u5199\uff1a<\/p>\n<p>&lt;CENTER&gt;&lt;ccid_nobr&gt;<\/p>\n<p>&lt;table width=&quot;400&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;<\/p>\n<p>bordercolorlight = &quot;black&quot; bordercolordark = &quot;#FFFFFF&quot; align=&quot;center&quot;&gt;<\/p>\n<p>&lt;tr&gt;<\/p>\n<p>&#160;&#160;&#160; &lt;td bgcolor=&quot;e6e6e6&quot; class=&quot;code&quot; style=&quot;font-size:9pt&quot;&gt;<\/p>\n<p>&#160;&#160;&#160; &lt;pre&gt;&lt;ccid_code&gt;<\/p>\n<p>PS C:\\&gt; &quot;lowercase Changecase Uppercase&quot;.ToUpper()<\/p>\n<p>LOWERCASE CHANGECASE UPPERCASE<\/p>\n<p>\u9700\u8981\u5f3a\u8c03\u7684\u662f\uff0c\u4e0d\u4f20\u9012\u53c2\u6570\u8c03\u7528\u65b9\u6cd5\u65f6\u4e0d\u80fd\u7701\u7565\u540e\u9762\u7684\u5706\u62ec\u53f7\uff1b\u5426\u5219PowerShell\u4f1a\u8ba4\u4e3a\u662f\u83b7\u5f97\u65b9\u6cd5\u672c\u8eab\u7684\u5bf9\u8c61\uff0c\u5982\u4e0b\u4f8b\u6240\u793a\uff1a<\/p>\n<p>PS C:\\&gt; &quot;lowercase Changecase Uppercase&quot;.ToUpper<\/p>\n<p>MemberType&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : Method<\/p>\n<p>OverloadDefinitions : {System.String ToUpper(), System.String ToUpper(CultureIn<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; fo culture)}<\/p>\n<p>TypeNameOfValue&#160;&#160;&#160;&#160; : System.Management.Automation.PSMethod<\/p>\n<p>Value&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : System.String ToUpper(), System.String ToUpper(CultureInf<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; o culture)<\/p>\n<p>Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : ToUpper<\/p>\n<p>IsInstance&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : True<\/p>\n<p>\u4e0a\u4f8b\u83b7\u53d6\u65b9\u6cd5\u672c\u8eab\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u901a\u5e38\u60c5\u51b5\u4e0b\u4ec5\u4ec5\u662f\u60f3\u53bb\u8c03\u7528\u8be5\u65b9\u6cd5\u3002<\/p>\n<p><strong>\u5bf9\u8c61\u9002\u914d\u5668<\/strong><\/p>\n<p>PowerShell\u5141\u8bb8\u4f7f\u7528\u591a\u79cd\u5e94\u7528\u7a0b\u5e8f\u7684\u81ea\u52a8\u5316\u5bf9\u8c61\u3001\u6d3b\u52a8\u76ee\u5f55\u6570\u636eActive Directory Data\u3001WMI\uff0c\u4ee5\u53ca\u4f7f\u7528\u4e0d\u540c\u6280\u672f\u548c\u539f\u578b\u5b9e\u73b0\u7684\u5bf9\u8c61\u3002\u8fd9\u6837\u9700\u8981\u4e00\u79cd\u673a\u5236\u6765\u4f7f\u5f97\u8fd9\u4e9b\u5bf9\u8c61\u5177\u6709.NET\u5bf9\u8c61\u90a3\u6837\u7684\u5916\u89c2\u548c\u5de5\u4f5c\u65b9\u5f0f\uff0c\u8fd9\u79cd\u673a\u5236\u79f0\u4e3a\u201c\u5bf9\u8c61\u9002\u914d\u201d\u3002\u5bf9\u4e8e\u5185\u7f6e\u5bf9\u8c61\uff0cShell\u77e5\u9053\u5982\u4f55\u4e0e\u5404\u79cd\u5bf9\u8c61\u7c7b\u578b\u914d\u5408\u5de5\u4f5c\uff0c\u8fd9\u4e9b\u6570\u636e\u4f1a\u5728\u4e00\u7cfb\u5217\u7684\u9002\u914d\u5668\u5bf9\u8c61\u95f4\u4f20\u9012\uff1b\u5bf9\u4e8e\u5916\u90e8\u5bf9\u8c61\uff0cShell\u5c06\u5176\u5305\u88f9\u5728\u5185\u90e8\u7684.NET\u5bf9\u8c61\u4e2d\u4f5c\u4e3a\u7684\u539f\u59cb\u5bf9\u8c61\u7684\u89c6\u56fe\u51fa\u73b0\u3002\u8fd9\u79cd\u89c6\u56fe\u5bf9\u8c61\u662fPSObject\uff0c\u7528\u9002\u914d\u5668\u83b7\u53d6\u5c5e\u6027\u548c\u65b9\u6cd5\u3002\u901a\u5e38\u60c5\u51b5\u4e0bPSObject\u4ec5\u4ec5\u4f5c\u4e3a\u4e00\u4e2a\u539f\u59cb\u5bf9\u8c61\uff0c\u53ef\u4ee5\u4f7f\u7528\u7279\u6b8a\u7684PSBase\u5c5e\u6027\u6765\u83b7\u53d6\u4e00\u4e2a\u539f\u59cb\u5bf9\u8c61\uff0c\u8fd9\u6837Shell\u53ef\u4ee5\u4f7f\u7528\u4e00\u7cfb\u5217\u9002\u914d\u5668\u64cd\u4f5c\u5bf9\u8c61\u3002<\/p>\n<p>\uff081\uff09ManagementObjectAdapter<\/p>\n<p>\u8fd9\u4e2a\u9002\u914d\u5668\u9488\u5bf9WMI\u8bbe\u8ba1\uff0c\u4f7f\u5f97\u64cd\u4f5cWMI\u5bf9\u8c61\u975e\u5e38\u5bb9\u6613\uff0c\u5982\u4ee5\u5bf9\u8c61\u5c5e\u6027\u7684\u65b9\u5f0f\u6765\u904d\u5386\u5176\u5c5e\u6027\u96c6\u5408\uff1a<\/p>\n<p>PS C:\\&gt; (Get-WmiObject win32_process)[0].PSBase<\/p>\n<p>.Properties[&quot;Caption&quot;].Value<\/p>\n<p>System Idle Process<\/p>\n<p>\u4e0a\u4f8b\u4f7f\u7528PSBase\u5c5e\u6027\u83b7\u53d6\u539f\u59cb\u7684\u672a\u7ecf\u9002\u914d\u5668\u5904\u7406\u7684\u5bf9\u8c61\uff0c\u901a\u8fc7\u9002\u914d\u5668\u53ea\u9700\u8981\u5982\u4e0b\u7b80\u5355\u4ee3\u7801\uff1a<\/p>\n<p>PS C:\\&gt; (Get-WmiObject win32_process)[0].Caption<\/p>\n<p>System Idle Process<\/p>\n<p>\uff082\uff09DirectoryEntryAdapter<\/p>\n<p>\u8fd9\u4e2a\u9002\u914d\u5668\u548cWindows\u6d3b\u52a8\u76ee\u5f55\u914d\u5408\u5de5\u4f5c\uff0c\u5de5\u4f5c\u65b9\u5f0f\u4e0eManagementObjectAdapter\u76f8\u4f3c\u3002<\/p>\n<p>\uff083\uff09DataRowAdapter<\/p>\n<p>\u8fd9\u4e2a\u9002\u914d\u5668\u662f\u5173\u4e8eADO.NET DAataRow\u5bf9\u8c61\uff0c\u53ef\u83b7\u53d6\u5176\u884c\u6570\u636e\u3002\u4f8b\u5982Xml\u6587\u4ef6\u7684\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p>&lt;Users&gt;<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;User&gt;<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Name&gt;John&lt;\/Name&gt;<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Age&gt;25&lt;\/Age&gt;<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;\/User&gt;<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;User&gt;<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Name&gt;Mike&lt;\/Name&gt;<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Age&gt;20&lt;\/Age&gt;<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;\/User&gt;<\/p>\n<p>&lt;\/Users&gt;<\/p>\n<p>\u5219\u83b7\u53d6\u5176\u4e2d\u884c\u6570\u636e\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<p>PS C:\\&gt; $ds=New-Object Data.DataSet<\/p>\n<p>PS C:\\&gt; $ds.ReadXml(&quot;C:\\PowerShell\\data.xml&quot;)<\/p>\n<p>InferSchema<\/p>\n<p>PS C:\\&gt; $ds.Tables[0].Rows[0].Name<\/p>\n<p>John<\/p>\n<p>PS C:\\&gt; $ds.Tables[0].Rows[0].PSBase[&quot;Name&quot;]<\/p>\n<p>John<\/p>\n<p>\uff084\uff09DataRowViewAdapter<\/p>\n<p>\u8be5\u9002\u914d\u5668\u7684\u5de5\u4f5c\u65b9\u5f0f\u4e0eDataRowAdapter\u76f8\u4f3c\uff0c\u5b83\u9488\u5bf9ADO.NET\u7684DataRowView\u5bf9\u8c61\u3002<\/p>\n<p>\uff085\uff09XmlNodeAdapter<\/p>\n<p>\u8fd9\u662f\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u7c7b\u578b\u8f6c\u6362\u9002\u914d\u5668\uff0c\u4f7f\u5bf9\u8c61\u548cXML\u5c5e\u6027\u4f5c\u4e3a\u66f4\u5bb9\u6613\u64cd\u4f5c\u7684\u5bf9\u8c61\u5c5e\u6027\u3002.NET\u4e2dXML\u7684\u5904\u7406\u770b\u8d77\u6765\u592a\u8fc7\u590d\u6742\uff0c\u4f7f\u5f97\u7528\u6237\u4e0d\u6e05\u695a\u4e00\u4e2a\u503c\u662f\u4f5c\u4e3aXML\u7684\u5c5e\u6027\uff0c\u8fd8\u662f\u4f5c\u4e3a\u4e00\u4e2a\u5143\u7d20\u503c\u5b58\u5728\u3002\u800c\u8fd9\u4e2a\u9002\u914d\u5668\u5c06\u6240\u6709\u7684\u503c\u4f5c\u4e3aPowerShell\u4ee3\u7801\u7684\u5c5e\u6027\u4fdd\u5b58\uff0c\u4e0b\u4f8b\u8bfb\u53d6XMI\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\uff1a<\/p>\n<p>PS C:\\&gt; $xmlDoc= New-Object xml.XmlDocument<\/p>\n<p>PS C:\\&gt; $xmlDoc.Load(&quot;c:\\PowerShell\\Data.xml&quot;)<\/p>\n<p>PS C:\\&gt; $xmlDoc.Users.User[0]<\/p>\n<p>Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Age<\/p>\n<p>&#8212;-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;<\/p>\n<p>John&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 25<\/p>\n<p>\u5c06\u5185\u90e8\u5143\u7d20\u4ee5\u5c5e\u6027\u5f62\u5f0f\u516c\u5f00\u7ed9\u5916\u90e8\u5e76\u5141\u8bb8\u5feb\u901f\u67e5\u8be2XML\u6811\uff0c\u4e0d\u9700\u8981\u901a\u8fc7XPath\u4e4b\u7c7b\u7684\u91cd\u91cf\u7ea7\u5de5\u5177\u3002<\/p>\n<p>\uff086\uff09ComAdapter<\/p>\n<p>\u4ee5\u5f80\u4f7f\u7528COM\u5bf9\u8c61\u65f6\u5fc5\u987b\u5904\u7406\u7f16\u8bd1\u7c7b\u578b\u4fe1\u606f\u5e76\u8bbf\u95eeCOM\u7c7b\u5e93\uff0c\u800c\u5728PowerShell\u4e2d\u7684COM\u9002\u914d\u5668\u53ef\u4ee5\u5b9e\u73b0\u8fd9\u4e9b\u529f\u80fd\u5e76\u9690\u85cf\u5177\u4f53\u7684\u7ec6\u8282\u3002\u4e0b\u4f8b\u8bf4\u660eInternet Explorer COM\u5bf9\u8c61\u5728PowerShell\u4e2d\u5982\u4f55\u5de5\u4f5c\u3002<\/p>\n<p>\u9996\u5148\u68c0\u67e5\u5f53\u524d\u662f\u5426\u8fd0\u884cInternet Explorer\u6d4f\u89c8\u5668\u8fdb\u7a0b\uff1a<\/p>\n<p>PS C:\\&gt; Get-Process i*<\/p>\n<p>Handles&#160; NPM(K)&#160;&#160;&#160; PM(K)&#160;&#160;&#160;&#160;&#160; WS(K) VM(M)&#160;&#160; CPU(s)&#160;&#160;&#160;&#160; Id ProcessName<\/p>\n<p>&#8212;&#8212;-&#160; &#8212;&#8212;&#160;&#160;&#160; &#8212;&#8211;&#160;&#160;&#160;&#160;&#160; &#8212;&#8211; &#8212;&#8211;&#160;&#160; &#8212;&#8212;&#160;&#160;&#160;&#160; &#8212; &#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&#160;&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 16&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0&#160;&#160;&#160; Idle<\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u672a\u542f\u52a8\u76f8\u5173\u5b9e\u4f8b\u540d\u4e3a\u201ciexplorer.exe\u201d\u7684\u8fdb\u7a0b\uff0c\u542f\u52a8\u4e00\u4e2a\u8fdb\u7a0b\uff1a<\/p>\n<p>PS C:\\&gt; $ie=New-Object -Com InternetExplorer.Application<\/p>\n<p>PS C:\\&gt; Get-Process i*<\/p>\n<p>Handles&#160; NPM(K)&#160;&#160;&#160; PM(K)&#160;&#160;&#160;&#160;&#160; WS(K) VM(M)&#160;&#160; CPU(s)&#160;&#160;&#160;&#160; Id ProcessName<\/p>\n<p>&#8212;&#8212;-&#160; &#8212;&#8212;&#160;&#160;&#160; &#8212;&#8211;&#160;&#160;&#160;&#160;&#160; &#8212;&#8211; &#8212;&#8211;&#160;&#160; &#8212;&#8212;&#160;&#160;&#160;&#160; &#8212; &#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&#160;&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 16&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0 Idle<\/p>\n<p>&#160;&#160;&#160; 265&#160;&#160;&#160;&#160;&#160; 11&#160;&#160;&#160;&#160; 9048&#160;&#160;&#160;&#160;&#160; 13308&#160;&#160;&#160; 85&#160;&#160;&#160;&#160; 0.36&#160;&#160; 1876 iexplore<\/p>\n<p>PS C:\\&gt; $ie.Visible=$true<\/p>\n<p>PS C:\\&gt; $ie.Visible=$false<\/p>\n<p>PS C:\\&gt; Get-Process i*<\/p>\n<p>Handles&#160; NPM(K)&#160;&#160;&#160; PM(K)&#160;&#160;&#160;&#160;&#160; WS(K) VM(M)&#160;&#160; CPU(s)&#160;&#160;&#160;&#160; Id ProcessName<\/p>\n<p>&#8212;&#8212;-&#160; &#8212;&#8212;&#160;&#160;&#160; &#8212;&#8211;&#160;&#160;&#160;&#160;&#160; &#8212;&#8211; &#8212;&#8211;&#160;&#160; &#8212;&#8212;&#160;&#160;&#160;&#160; &#8212; &#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&#160;&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 16&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0&#160;&#160;&#160; Idle<\/p>\n<p>&#160;&#160;&#160; 596&#160;&#160;&#160;&#160;&#160; 23&#160;&#160;&#160; 37636&#160;&#160;&#160;&#160;&#160; 45576&#160;&#160; 161&#160;&#160;&#160;&#160; 4.09&#160;&#160; 1876&#160; iexplore<\/p>\n<p>PS C:\\&gt; $ie.Visible=$true<\/p>\n<p>PS C:\\&gt; $ie.Visible=$false<\/p>\n<p>PS C:\\&gt; $ie.Application<\/p>\n<p>Application&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : System.__ComObject<\/p>\n<p>Parent&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : System.__ComObject<\/p>\n<p>Container&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; :<\/p>\n<p>Document&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : System.__ComObject<\/p>\n<p>TopLevelContainer&#160;&#160;&#160; : True<\/p>\n<p>Type&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : HTML \u6587\u6863<\/p>\n<p>Left&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 774<\/p>\n<p>Top&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 500<\/p>\n<p>Width&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 692<\/p>\n<p>Height&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 457<\/p>\n<p>LocationName&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : \u7f51\u6613<\/p>\n<p>LocationURL&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : http:\/\/www.163.com\/<\/p>\n<p>Busy&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : False<\/p>\n<p>Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : Windows Internet Explorer<\/p>\n<p>HWND&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 591414<\/p>\n<p>FullName&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE<\/p>\n<p>Path&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : C:\\Program Files\\Internet Explorer\\<\/p>\n<p>Visible&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : False<\/p>\n<p>StatusBar&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : True<\/p>\n<p>StatusText&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : \u5b8c\u6210<\/p>\n<p>ToolBar&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 1<\/p>\n<p>MenuBar&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : True<\/p>\n<p>FullScreen&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : False<\/p>\n<p>ReadyState&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 4<\/p>\n<p>Offline&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : False<\/p>\n<p>Silent&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : False<\/p>\n<p>RegisterAsBrowser&#160;&#160;&#160; : False<\/p>\n<p>RegisterAsDropTarget : True<\/p>\n<p>TheaterMode&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : False<\/p>\n<p>AddressBar&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : True<\/p>\n<p>Resizable&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : True<\/p>\n<p>\u6ce8\u610f\u5728\u6267\u884c\u7b2c1\u4e2a\u8bed\u53e5\u65f6\u521b\u5efa\u4e86IE\u8fdb\u7a0b\uff0c\u542f\u52a8IE\u7684\u540c\u65f6\u4f1a\u83b7\u5f97\u7126\u70b9\uff0c\u6b64\u65f6\u547d\u4ee4\u884c\u5df2\u7ecf\u5931\u53bb\u7126\u70b9\u3002\u5728\u5efa\u7acb\u5bf9\u8c61$ie\u65f6\u542f\u52a8\u4e86\u4e00\u4e2aIE\u7684\u8fdb\u7a0b\uff0c\u53ea\u662f\u8fd9\u4e2a\u8fdb\u7a0b\u5728\u540e\u53f0\u8fd0\u884c\u3002\u8bed\u53e5$ie.Visible=$true\u663e\u793a\u754c\u9762\uff0c\u4e3a\u4e86\u5224\u65ad\u9690\u85cf\u8fd9\u4e2a\u8fdb\u7a0b\u754c\u9762\u540e\u518d\u6b21\u663e\u793a\u7684\u7a97\u53e3\u662f\u4e0d\u662f\u7b2c1\u6b21\u542f\u52a8\u65f6\u7684\u7a97\u53e3\uff0c\u4f7f\u7528\u8fd9\u4e2aIE\u6d4f\u89c8\u4e00\u4e2a\u7f51\u7ad9\u3002\u52a0\u8f7d\u7f51\u7ad9\u4e4b\u540e\uff0c\u4f7f\u7528\u547d\u4ee4$ie.Visible=$false\u9690\u85cf\u754c\u9762\u3002\u67e5\u8be2\u8fdb\u7a0b\u53ef\u4ee5\u770b\u5230\u8fdb\u7a0b\u4ecd\u7136\u8fd0\u884c\uff0c\u7528$ie.Application\u67e5\u770b\u5f53\u524dIE\u52a0\u8f7d\u7684\u6587\u6863\u4fe1\u606f\u3002\u5982\u679c\u518d\u6b21\u663e\u793a\u754c\u9762\u5e76\u5173\u95ed\u8fd9\u4e2a\u8fdb\u7a0b\uff0c\u518d\u6b21\u4f7f\u7528$ie.Visible=$true\u64cd\u4f5c\u5bf9\u8c61\uff0c\u5373\u53ef\u770b\u5230\u5982\u4e0b\u9519\u8bef\u3002\u8fd9\u610f\u5473\u7740\u5728\u4f7f\u7528PowerShell\u7684ComAdapter\u5bf9COM\u5bf9\u8c61\u8fdb\u884c\u64cd\u4f5c\u65f6COM\u5bf9\u8c61\u4ee5RPC\u670d\u52a1\u5668\u7684\u5f62\u5f0f\u5b58\u5728\u3002\u800cComAdapter\u662f\u670d\u52a1\u7684\u5ba2\u6237\u7aef\uff0c\u5b83\u5411RPC\u670d\u52a1\u5668\u53d1\u51fa\u8bf7\u6c42\u3002\u670d\u52a1\u5668\u6267\u884c\u76f8\u5e94\u7684\u64cd\u4f5c\u5e76\u8fd4\u56de\u7ed3\u679c\uff0c\u6574\u4e2a\u8fc7\u7a0b\u5bf9\u5e94\u9488\u5bf9COM\u5bf9\u8c61\u5e94\u7528\u7684\u64cd\u4f5c\uff1a<\/p>\n<p>PS C:\\&gt; $ie.Visible=$true<\/p>\n<p>Exception setting &quot;Visible&quot;: &quot;RPC \u670d\u52a1\u5668\u4e0d\u53ef\u7528\u3002 (\u5f02\u5e38\u6765\u81ea HRESULT:0x800706BA)&quot;<\/p>\n<p>At line:1 char:5<\/p>\n<p>+ $ie. &lt;&lt;&lt;&lt; Visible=$true<\/p>\n<p><strong>\u7c7b\u578b\u6269\u5c55<\/strong><\/p>\n<p>\u5bf9\u8c61\u9002\u914d\u5668\u662f\u6539\u53d8\u5bf9\u8c61\u8868\u73b0\u65b9\u5f0f\u7684\u4e3b\u8981\u673a\u5236\uff0c\u4f46\u662f\u5176\u6839\u6e90\u4ecd\u7136\u662fPowerShell\u3002\u9002\u914d\u5668\u4f5c\u4e3a.NET\u5bf9\u8c61\u6765\u6267\u884c\uff0c\u800c\u4e14\u662fPowerShell\u4ee3\u7801\u57fa\u7840\u4e0d\u53ef\u5206\u5272\u7684\u7ec4\u6210\u90e8\u5206\u3002\u7531\u4e8e\u6ca1\u6709\u63d0\u4f9b\u63a5\u53e3\u5141\u8bb8\u7528\u6237\u521b\u5efa\u81ea\u5df1\u7684\u9002\u914d\u5668\u6216\u5728\u73b0\u6709\u9002\u914d\u5668\u4e4b\u4e0a\u6269\u5c55\uff0c\u56e0\u6b64PowerShell\u63d0\u4f9b\u4e86\u4e00\u79cd\u673a\u5236\u7528\u4e8e\u4fee\u6539\u5bf9\u8c61\u7c7b\u578b\u3002\u5373\u5bf9\u8c61\u6269\u5c55\uff0c\u4f7f\u7528\u6237\u80fd\u591f\u901a\u8fc7\u63d0\u4f9b\u989d\u5916\u7684\u4ee3\u7801\u548c\u6570\u636e\u5728\u8fd0\u884c\u65f6\u4e3a\u5bf9\u8c61\u548c\u5bf9\u8c61\u7c7b\u578b\u6dfb\u52a0\u6210\u5458\uff0c\u5305\u62ec\u5c5e\u6027\u548c\u65b9\u6cd5\u3002\u5982\u4e0b\u4ee3\u7801\u83b7\u53d6System.Diagnostics.Process\u7c7b\u578b\u7684\u6269\u5c55\u5c5e\u6027\uff1a<\/p>\n<p>PS C:\\&gt; (Get-Process)[0] |Get-Member -type Aliasproperty<\/p>\n<p>&#160;&#160; TypeName: System.Diagnostics.Process<\/p>\n<p>Name&#160;&#160;&#160; MemberType&#160;&#160;&#160; Definition<\/p>\n<p>&#8212;-&#160;&#160;&#160; &#8212;&#8212;&#8212;-&#160;&#160;&#160; &#8212;&#8212;&#8212;-<\/p>\n<p>Handles AliasProperty Handles = Handlecount<\/p>\n<p>Name&#160;&#160;&#160; AliasProperty Name = ProcessName<\/p>\n<p>NPM&#160;&#160;&#160;&#160; AliasProperty NPM = NonpagedSystemMemorySize<\/p>\n<p>PM&#160;&#160;&#160;&#160;&#160; AliasProperty PM = PagedMemorySize<\/p>\n<p>VM&#160;&#160;&#160;&#160;&#160; AliasProperty VM = VirtualMemorySize<\/p>\n<p>WS&#160;&#160;&#160;&#160;&#160; AliasProperty WS = WorkingSet<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u83b7\u53d6\u6240\u6709\u8fdb\u7a0b\u4e2d\u6700\u9ad8\u4f18\u5148\u7ea7\u7684\u8fdb\u7a0b\uff0c\u5e76\u663e\u793a\u5176\u522b\u540d\u5c5e\u6027\u3002\u53ef\u4ee5\u770b\u5230PowerShell\u6269\u5c55\u4e86Process\u7c7b\u578b\uff0c\u6240\u4ee5\u80fd\u591f\u4f7f\u7528\u5176\u4e2d\u4e00\u4e9b\u5c5e\u6027\u516c\u5f00\u7684\u8f83\u77ed\u540d\u79f0\uff0c\u7528Name\u6765\u4ee3\u66ffProcessName\uff1b\u7528WS\u6765\u4ee3\u66ffWorkingSet\u7b49\u3002<\/p>\n<p>\u522b\u540d\u5c5e\u6027\u4ec5\u4ec5\u662f\u901a\u8fc7\u540d\u79f0\u5f15\u7528\u5176\u4ed6\u5c5e\u6027\u5e76\u8fd4\u56de\u8be5\u5c5e\u6027\u7684\u503c\uff0c\u5c5e\u6027\u522b\u540d\u5316\u901a\u5e38\u662f\u7528\u6765\u7f29\u77ed\u4e00\u4e9b\u6700\u5e38\u7528\u7684\u7279\u6027\u6765\u4f7f\u5f97\u5bf9\u8c61\u7528\u8d77\u6765\u65b9\u4fbf\uff0c\u5982\uff1a<\/p>\n<p>PS C:\\&gt; Get-Member -Input(1,2,3) -type AliasProperty<\/p>\n<p>&#160;&#160; TypeName: System.Object[]<\/p>\n<p>Name&#160; MemberType&#160;&#160;&#160; Definition<\/p>\n<p>&#8212;-&#160; &#8212;&#8212;&#8212;-&#160;&#160;&#160; &#8212;&#8212;&#8212;-<\/p>\n<p>Count AliasProperty Count = Length<\/p>\n<p>\u80fd\u591f\u901a\u8fc7\u8bbf\u95eePSExtended\u5c5e\u6027\u6765\u8bbf\u95ee\u7c7b\u578b\u5bf9\u8c61\u89c6\u56fe\uff0c\u4e0b\u4f8b\u83b7\u53d6Process\u7c7b\u578b\u7684\u6240\u6709\u6269\u5c55\u6210\u5458\uff1a<\/p>\n<p>&lt;CENTER&gt;&lt;ccid_nobr&gt;<\/p>\n<p>&lt;table width=&quot;400&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;<\/p>\n<p>bordercolorlight = &quot;black&quot; bordercolordark = &quot;#FFFFFF&quot; align=&quot;center&quot;&gt;<\/p>\n<p>&lt;tr&gt;<\/p>\n<p>&#160;&#160;&#160; &lt;td bgcolor=&quot;e6e6e6&quot; class=&quot;code&quot; style=&quot;font-size:9pt&quot;&gt;<\/p>\n<p>&#160;&#160;&#160; &lt;pre&gt;&lt;ccid_code&gt;<\/p>\n<p>PS C:\\&gt; (Get-Process)[0].PSExtended | Get-Member<\/p>\n<p>&#160;&#160; TypeName: System.Management.Automation.PSMemberSet<\/p>\n<p>Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; MemberType&#160;&#160;&#160;&#160; Definition<\/p>\n<p>&#8212;-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8212;&#8212;&#8212;-&#160;&#160;&#160;&#160; &#8212;&#8212;&#8212;-<\/p>\n<p>Handles&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AliasProperty&#160; Handles = Handlecount<\/p>\n<p>Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AliasProperty&#160; Name = ProcessName<\/p>\n<p>NPM&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AliasProperty&#160; NPM = NonpagedSystemMemorySize<\/p>\n<p>PM&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AliasProperty&#160; PM = PagedMemorySize<\/p>\n<p>VM&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AliasProperty&#160; VM = VirtualMemorySize<\/p>\n<p>WS&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AliasProperty&#160; WS = WorkingSet<\/p>\n<p>__NounName&#160;&#160;&#160;&#160;&#160; NoteProperty&#160;&#160; System.String __NounName=Process<\/p>\n<p>PSConfiguration PropertySet&#160;&#160;&#160; PSConfiguration {Name, Id, PriorityClass, Fil&#8230;<\/p>\n<p>PSResources&#160;&#160;&#160;&#160; PropertySet&#160;&#160;&#160; PSResources {Name, Id, Handlecount, WorkingSe&#8230;<\/p>\n<p>Company&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ScriptProperty System.Object Company {get=$this.Mainmodule.F&#8230;<\/p>\n<p>CPU&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ScriptProperty System.Object CPU {get=$this.TotalProcessorTi&#8230;<\/p>\n<p>Description&#160;&#160;&#160;&#160; ScriptProperty System.Object Description {get=$this.Mainmodu&#8230;<\/p>\n<p>FileVersion&#160;&#160;&#160;&#160; ScriptProperty System.Object FileVersion {get=$this.Mainmodu&#8230;<\/p>\n<p>Path&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ScriptProperty System.Object Path {get=$this.Mainmodule.File&#8230;<\/p>\n<p>Product&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ScriptProperty System.Object Product {get=$this.Mainmodule.F&#8230;<\/p>\n<p>ProductVersion&#160; ScriptProperty System.Object ProductVersion {get=$this.Mainm&#8230;<\/p>\n<p><strong>\u603b\u7ed3<\/strong><\/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\u672c\u6587\u5206\u522b\u9488\u5bf9PowerShell\u7684\u5bf9\u8c61\u5c5e\u6027\uff0c\u5bf9\u8c61\u65b9\u6cd5\u548c\u5bf9\u8c61\u9002\u914d\u5668\uff0c\u4ee5\u53ca\u5bf9\u8c61\u7c7b\u578b\u6269\u5c55\u8fdb\u884c\u63cf\u8ff0\uff0c\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<\/p>\n<p>\u5fae\u8f6fMSDN\u539f\u6587\u5730\u5740\uff1a<a title=\"http:\/\/msdn.microsoft.com\/zh-cn\/ff943778.aspx\" href=\"http:\/\/msdn.microsoft.com\/zh-cn\/ff943778.aspx\">http:\/\/msdn.microsoft.com\/zh-cn\/ff943778.aspx<\/a><\/p>\n<p>\u8d5b\u8fea\u7f51\u539f\u6587\u5730\u5740\uff1a<a title=\"http:\/\/news.ccidnet.com\/art\/32857\/20100608\/2081057_1.html\" href=\"http:\/\/news.ccidnet.com\/art\/32857\/20100608\/2081057_1.html\">http:\/\/news.ccidnet.com\/art\/32857\/20100608\/2081057_1.html<\/a><\/p>\n<p>\u4f5c\u8005: \u4ed8\u6d77\u519b   <br \/>\u7248\u6743\uff1a\u672c\u6587\u7248\u6743\u5f52\u4f5c\u8005\u6240\u6709    <br \/>\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    <br \/>\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     <br \/>\u4e2a\u4eba\u7f51\u7ad9: http:\/\/txj.shell.tor.hu<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell\u4e2d\u9075\u5faa\u7684\u4e00\u5207\u90fd\u662f\u5bf9\u8c61\uff0c\u5177\u6709\u4e00\u4e9b\u4e13\u5c5e\u7684\u7279\u6027\uff0c\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u5c5e\u6027\u6765\u533a\u522b\u5b83\u4eec\u3002\u7531\u4e8eWindows\u548c [&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-33102","post","type-post","status-publish","format-standard","hentry","category-powershell"],"_links":{"self":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/posts\/33102"}],"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=33102"}],"version-history":[{"count":1,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/posts\/33102\/revisions"}],"predecessor-version":[{"id":33812,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/posts\/33102\/revisions\/33812"}],"wp:attachment":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}