<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-20327311</id><updated>2026-04-16T03:19:31.013-04:00</updated><title type='text'>PowerShell For Fun</title><subtitle type='html'>Some Windows PowerShell scripts and utilities I wrote just for fun. If you were interested in scripting with PowerShell (a biologist would be better), you might have some fun here.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default?alt=atom'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default?alt=atom&amp;start-index=26&amp;max-results=25'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07015650594748926887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>61</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-20327311.post-673581471031617043</id><published>2007-11-30T14:22:00.000-05:00</published><updated>2007-11-30T16:32:52.919-05:00</updated><title type='text'>PowerShell Script: Amazon WII Watch</title><content type='html'>I just wanted a WII for Christmas gift and didn&#39;t want to spend $500 on ebay.&lt;br /&gt;&lt;br /&gt;A Small powershell script will do!&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;# Begin of script&lt;br /&gt;# =============================================================&lt;br /&gt;# This code is for test purposes only. Use it at your own risk.&lt;br /&gt;# =============================================================&lt;br /&gt;param([string] $query= &quot;B0009VXBAQ&quot;, [string] $button = &quot;btn-atc._V46858960_.gif&quot;)&lt;br /&gt;&lt;br /&gt;#Submit query sequence&lt;br /&gt;&quot;=================================================================&quot;&lt;br /&gt;&quot;ASIN: &quot; + $query&lt;br /&gt;&quot;Button: &quot; + $button&lt;br /&gt;&quot;&quot;&lt;br /&gt;&quot;Submit query ...&quot;&lt;br /&gt;$uri=&quot;http://www.amazon.com/gp/product/&quot; + $query&lt;br /&gt;$AmazonClient = new-object System.Net.WebClient&lt;br /&gt;&lt;br /&gt;#checking for results&lt;br /&gt;While ($true)&lt;br /&gt;{&lt;br /&gt;$pagecontent = $AmazonClient.DownloadString($uri);&lt;br /&gt;&quot;=================================================================&quot;&lt;br /&gt;# Get Availability&lt;br /&gt;if ($pagecontent -match $button)&lt;br /&gt;{&lt;br /&gt;    write-host &quot;In Stock`a`a`a&quot; -foregroundcolor Red&lt;br /&gt; }&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;    write-host &quot;out of Stock&quot; -foregroundcolor yellow&lt;br /&gt;}&lt;br /&gt;[datetime]::Now.tostring()&lt;br /&gt;&quot;Wait...&quot;&lt;br /&gt;Start-sleep 60&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#End of script&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;=================================================================&lt;br /&gt;out of Stock&lt;br /&gt;2007-11-30 13:07:52&lt;br /&gt;Wait...&lt;br /&gt;=================================================================&lt;br /&gt;In Stock&lt;br /&gt;&lt;br /&gt;2007-11-30 13:08:58&lt;br /&gt;Wait...&lt;br /&gt;=================================================================&lt;br /&gt;out of Stock&lt;br /&gt;2007-11-30 13:10:01&lt;br /&gt;Wait...&lt;br /&gt;=================================================================&lt;br /&gt;In Stock&lt;br /&gt;&lt;br /&gt;2007-11-30 13:11:05&lt;br /&gt;Wait...&lt;br /&gt;&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/673581471031617043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2007/11/powershell-script-amazon-wii-watch.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/673581471031617043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/673581471031617043'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2007/11/powershell-script-amazon-wii-watch.html' title='PowerShell Script: Amazon WII Watch'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-5628975857178904212</id><published>2007-02-28T14:07:00.000-05:00</published><updated>2007-02-28T14:14:09.424-05:00</updated><title type='text'>New Project Home at CodePlex.com</title><content type='html'>Private workspaces @ gotdotnet.com will be phased out on 3/20/2007. I moved new project home to CodePlex.com @ &lt;a href=&quot;http://www.codeplex.com/powershellremoting&quot;&gt;http://www.codeplex.com/powershellremoting&lt;/a&gt;. You can get news, report bugs and request feature there.&lt;br /&gt;&lt;br /&gt;We are working on a beta release on X64 and VISTA. We will come up a road map for future PowerShell Remoting development soon. If you have any suggestions, please reply here or discussion section @ &lt;a href=&quot;http://www.codeplex.com/powershellremoting&quot;&gt;new Powershell Remoting project home&lt;/a&gt;.     &lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/5628975857178904212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2007/02/new-project-home-at-codeplexcom.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/5628975857178904212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/5628975857178904212'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2007/02/new-project-home-at-codeplexcom.html' title='New Project Home at CodePlex.com'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-280122012654205011</id><published>2007-01-25T14:47:00.000-05:00</published><updated>2007-01-25T14:54:16.756-05:00</updated><title type='text'>PowerShell Remoting Go OpenSource!</title><content type='html'>&lt;p&gt;You can now download full source code of PowerShell Remoting from my &lt;a href=&quot;http://www.gotdotnet.com/workspaces/workspace.aspx?id=ce09cdaf-7da2-4f1c-bed3-f8cb35de5aea&quot;&gt;workspace&lt;/a&gt;. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;Let&#39;s welcome our new developers: &lt;span style=&quot;font-weight:bold;&quot;&gt;Romangeeko&lt;/span&gt; and &lt;span style=&quot;font-weight:bold;&quot;&gt;JaviRuso&lt;/span&gt;. We are still looking for developers. If you are intersted, please Email me (shenzhonghao AT gmail DOT com).&lt;br /&gt; &lt;br /&gt;Enjoy.&lt;br /&gt;&lt;br /&gt;&lt;p&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt;    &lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;   &lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/280122012654205011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2007/01/powershell-remoting-go-opensource.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/280122012654205011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/280122012654205011'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2007/01/powershell-remoting-go-opensource.html' title='PowerShell Remoting Go OpenSource!'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-116595261034903834</id><published>2006-12-12T14:31:00.000-05:00</published><updated>2006-12-12T14:43:30.416-05:00</updated><title type='text'>Looking For Developers</title><content type='html'>I am very busy with my daytime job and my new born daughter. So I don&#39;t have enough time for PowerShell Remoting Project. But I would like to continue the development of this project in a community (probably open source). &lt;br /&gt;&lt;br /&gt;I have been contact some friends also intersted in PowerShell Remoting.There are also a couple of user requesting for source code of PowerShell Remoting. If you are interested in this project and would like to contribute your time to it, please Email me (shenzhonghao AT gmail DOT com). It would be great if you could include some details about your previous development experience. Any other suggestion about this project is also welcome.   &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/116595261034903834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/12/looking-for-developers.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/116595261034903834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/116595261034903834'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/12/looking-for-developers.html' title='Looking For Developers'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-116361952387760014</id><published>2006-11-15T14:35:00.000-05:00</published><updated>2006-11-22T14:27:54.700-05:00</updated><title type='text'>PowerShell Remoting version 0.2.9.0 For V1.0</title><content type='html'>PowerShell Remoting version 0.2.9.0  &lt;br /&gt;1. Rebuild For PowerShell V1.0 RTW. &lt;br /&gt;2. Fix &quot;All User&quot; profile not load at server problem. &lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;a href=&quot;http://www.gotdotnet.com/workspaces/workspace.aspx?id=ce09cdaf-7da2-4f1c-bed3-f8cb35de5aea&quot;&gt;Download here&lt;/a&gt; (381k)&lt;br /&gt;&lt;br&gt; Some user reported that PowerShellRemoting.ClientPSHost.dll is not registered properly in x64 platform. So I also uploaded a x64 build of PowerShell Remoting.&lt;font color=&quot;red&quot;&gt; Warning: This package have not been tested on x64 platform, use it at your own risk. &lt;br /&gt;&lt;br&gt;&lt;br&gt;Please uninstall old version of Powershell Remoting before uninstall PowerShell RC2. After install PowerShell v1.0, you can install new version of Powershell Remoting.&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/116361952387760014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/11/powershell-remoting-version-0290-for.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/116361952387760014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/116361952387760014'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/11/powershell-remoting-version-0290-for.html' title='PowerShell Remoting version 0.2.9.0 For V1.0'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-115937567639428150</id><published>2006-09-27T12:42:00.000-04:00</published><updated>2006-09-29T11:30:52.010-04:00</updated><title type='text'>PowerShell Remoting version 0.2.8.0 For RC2 Drop</title><content type='html'>Windows PowerShell Team finally released PowerShell RC2. If you are running windows server 2003, you can enjoy new active directory provider. If you are a windows XP (non-English) user like me, I suggest you download &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=cf02f527-9527-49cc-bdc5-23c3c22493e0&amp;amp;DisplayLang=en&quot;&gt;Windows PowerShell 1.0 RC2 Language-Neutral Package for Windows XP (KB925228) &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Some important changes not in release note.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Big window, different color&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;gt; $host.ui.rawui&lt;br /&gt;&lt;br /&gt;ForegroundColor&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : DarkYellow&lt;br /&gt;BackgroundColor&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : DarkMagenta&lt;br /&gt;CursorPosition&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0,4&lt;br /&gt;WindowPosition&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0,0&lt;br /&gt;CursorSize&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 25&lt;br /&gt;BufferSize&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 120,3000&lt;br /&gt;WindowSize&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 120,44&lt;br /&gt;MaxWindowSize&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 120,44&lt;br /&gt;MaxPhysicalWindowSize : 128,44&lt;br /&gt;KeyAvailable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : False&lt;br /&gt;WindowTitle&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Windows PowerShell&lt;br /&gt;&lt;/blockquote&gt;If you like color setting of old version&lt;br /&gt;&lt;blockquote&gt;&amp;gt;$host.ui.rawui. ForegroundColor = &quot;gray&quot;&lt;br /&gt;&amp;gt;$host.ui.rawui. BackgroundColor = &quot;black&quot;&lt;br /&gt;&amp;gt;clear&lt;br /&gt;&lt;/blockquote&gt;&lt;b&gt;Path change&lt;/b&gt;&lt;br /&gt;1. Home&lt;br /&gt;C:\WINDOWS\system32\windowspowershell&lt;br /&gt;&lt;br /&gt;2. User Profile folder&lt;br /&gt;&amp;lt;My Documents&amp;gt;\WindowsPowerShell&lt;br /&gt;&lt;br /&gt;3. Assembly change&lt;br /&gt;System.Management.Automation now goes to GAC&lt;br /&gt;&lt;br /&gt;PowerShell Remoting version 0.2.8.0  &lt;br /&gt;1. Rebuild for PowerShell RC2 version&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.gotdotnet.com/workspaces/workspace.aspx?id=ce09cdaf-7da2-4f1c-bed3-f8cb35de5aea&quot;&gt;Download from here.&lt;/a&gt; (381k)&lt;br /&gt;&lt;br /&gt;&lt;font color=&quot;red&quot;&gt;Please uninstall old version of Powershell Remoting before uninstall PowerShell RC1. After install PowerShell RC2, you can install new version of Powershell Remoting.&lt;/font&gt;&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/115937567639428150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/09/powershell-remoting-version-0280-for.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115937567639428150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115937567639428150'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/09/powershell-remoting-version-0280-for.html' title='PowerShell Remoting version 0.2.8.0 For RC2 Drop'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-115492091258094974</id><published>2006-08-06T23:19:00.000-04:00</published><updated>2006-08-06T23:21:52.600-04:00</updated><title type='text'>Do You Know There is a $Host Variable</title><content type='html'>PowerShell has a build-in &lt;b&gt;$host&lt;/b&gt; variable which expose a System. Management. Automation. Internal. Host. InternalHost object. It is an internal object so you can&#39;t access it from assembly but monad team made it directly accessible from PowerShell script. $host is interesting and powerful. Just an example how powerful it is: my &lt;a href=&quot;http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=ce09cdaf-7da2-4f1c-bed3-f8cb35de5aea&quot;&gt;PowerShell Remoting&lt;/a&gt; &quot;steal&quot; the $host.UI for user interface remoting.&lt;br /&gt;&lt;br /&gt;$Host is an implementation of System. Management. Automation. Host. PSHost abstract class. PSHost defined some important properties and methods which will be used for all cmdlet. For more detailed information about &lt;b&gt;PSHost&lt;/b&gt;, you can consult &lt;a href=&quot;http://windowssdk.msdn.microsoft.com/en-us/library/system.management.automation.host.aspx&quot;&gt;Monad SDK online&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Let&#39;s see what we can do with $host&lt;br /&gt;&lt;b&gt;1. Some read-only properties provide information about current host. &lt;/b&gt;&lt;br /&gt;These could be useful when you have to distinguish among multiple hosts (For example, my PowerShell Remoting has a remote host. Remote host have different Name, InstanceId, Version, etc).&lt;br /&gt;&lt;ul&gt;&lt;li&gt;CurrentCulture&lt;/li&gt;&lt;li&gt;CurrentUICulture&lt;/li&gt;&lt;li&gt;InstanceId&lt;/li&gt;&lt;li&gt;Name&lt;/li&gt;&lt;li&gt;PrivateData&lt;/li&gt;&lt;li&gt;Version&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;br /&gt;2. Two methods to support legacy application (like ping.exe). &lt;/b&gt;&lt;br /&gt;Usually you do not need to call them directly. Monad engine will call them automatically if you invoke legacy application.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;NotifyBeginApplication()&lt;/li&gt;&lt;li&gt;NotifyEndApplication()&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;br /&gt;3. Two methods about nested prompt. &lt;/b&gt;&lt;br /&gt;I already discussed &lt;a href=&quot;http://mshforfun.blogspot.com/2006/06/enter-nested-prompt-function.html&quot;&gt;how to use those methods previously&lt;/a&gt;. &lt;br /&gt;&lt;ul&gt;&lt;li&gt;EnterNestedPrompt()&lt;/li&gt;&lt;li&gt;ExitNestedPrompt() &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;4. One method to force PowerShell exit. &lt;/b&gt;&lt;br /&gt;This could be useful if some sever error occurs and you want to quit PowerShell.exe from your script. You can also pass error code to environment. For example:&lt;br /&gt;&lt;blockquote&gt;&amp;gt;$host.SetShouldExit(10000)&lt;br /&gt;&lt;/blockquote&gt;&lt;b&gt;5. $host.UI&lt;/b&gt;&lt;br /&gt;This is an implementation of PSHostUserInterface object which expose some import user interface API.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;5.1 &lt;font color=&quot;#000099&quot;&gt;public override&lt;/font&gt; Dictionary&amp;lt;string, PSObject&amp;gt; Prompt(string caption, string message, Collection&amp;lt;FieldDescription&amp;gt; descriptions)&lt;/b&gt;&lt;br /&gt;This API is called when cmdlet required field(s) is null or empty. It is capable of get user input ([string]) and cnvert them to almost any .Net type in current appdomain. But the task of constructing Collection&amp;lt;FieldDescription&amp;gt; from script can be daunting. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;5.2 &lt;font color=&quot;#000099&quot;&gt;public &lt;/font&gt;&lt;font color=&quot;#000099&quot;&gt;override &lt;/font&gt;int PromptForChoice(string caption, string message, Collection&amp;lt;ChoiceDescription&amp;gt; choices, int defaultChoice)&lt;/b&gt;&lt;br /&gt;This is standard PowerShell text-base menu system. Don&#39;t re-invent wheels! If you want to provide a menu for user input, look nowhere and this method got you all covered. &lt;a href=&quot;http://mow001.blogspot.com/2005/12/msh-prompt-user-function-with-help.html&quot;&gt;Mow has a nice example of how to use this methods&lt;/a&gt;.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;5.3 Some more input API to get user input&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;ReadLine: Read a line from standard input, similar to read-host cmdlet&lt;/li&gt;&lt;li&gt;PromptForCredential: Get PSCredential object from User input, similar to get-credential cmdlet.&lt;/li&gt;&lt;li&gt;ReadLineAsSecureString: read from standard input and convert to SecureString, similar to Read-host -AsSecureString&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;br /&gt;5.4 Some output API to direct output to different channel and with color support.&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Write: Write to standard output without /n/r&lt;/li&gt;&lt;li&gt;WriteLine: Write a line to standard output&lt;/li&gt;&lt;li&gt;WriteProgress: Wrtie to Progress panel, similar to Write-progress cmdlet &lt;/li&gt;&lt;li&gt;WriteDebugLine: Write to Debug channel, similar to Write-debug cmdlet&lt;/li&gt;&lt;li&gt;WriteErrorLine: Write to Standard Error, similar to Write-error cmdlet&lt;/li&gt;&lt;li&gt;WriteVerboseLine: Write to Verbose channel, similar to Write-verbose cmdlet&lt;/li&gt;&lt;li&gt;WriteWarningLine: Wrtie to Warning channel, similar to Write-warning cmdlet&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;5.5 $Host.UI.RawUI&lt;/b&gt;&lt;br /&gt;This is an implementation of PSHostRawUserInterface abstract class. This is a new concept in PowerShell. &lt;a href=&quot;http://mshforfun.blogspot.com/2006/05/perfect-prompt-for-windows-powershell.html&quot;&gt;In the prompt post, we use this object to do a lot of tricks&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;5.5.1 Some properties to control Console window size, window title, cursor, buffer size, background/foreground color &lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;BackgroundColor&lt;/li&gt;&lt;li&gt;BufferSize&lt;/li&gt;&lt;li&gt;CursorPosition&lt;/li&gt;&lt;li&gt;CursorSize&lt;/li&gt;&lt;li&gt;ForegroundColor&lt;/li&gt;&lt;li&gt;KeyAvailable&lt;/li&gt;&lt;li&gt;MaxPhysicalWindowSize&lt;/li&gt;&lt;li&gt;MaxWindowSize&lt;/li&gt;&lt;li&gt;WindowPosition&lt;/li&gt;&lt;li&gt;WindowSize&lt;/li&gt;&lt;li&gt;WindowTitle&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;5.5.2 Some console buffer API. Lee has a great &lt;a href=&quot;http://www.leeholmes.com/blog/burnconsolemshPartIIAWorkingImplementation.aspx&quot;&gt;burn-console &lt;/a&gt;script to demonstrate these methods.&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;FlushInputBuffer&lt;/li&gt;&lt;li&gt;GetBufferContents&lt;/li&gt;&lt;li&gt;LengthInBufferCells&lt;/li&gt;&lt;li&gt;NewBufferCellArray&lt;/li&gt;&lt;li&gt;ScrollBufferContents&lt;/li&gt;&lt;li&gt;SetBufferContents&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;br /&gt;5.5.3&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#000099&quot;&gt;public override&lt;/font&gt; KeyInfo ReadKey(ReadKeyOptions options)&lt;/b&gt;&lt;br /&gt;It is a powerful API to read keyboard input. Check out the retuned KeyInfo object, with this method, one can theoretically write a script act like a simple screen editor. &lt;br /&gt;Here is the ReadKeyOption enum:&lt;br /&gt;&lt;blockquote&gt;[Flags]&lt;br /&gt;&lt;font color=&quot;#000099&quot;&gt;public&lt;/font&gt; enum ReadKeyOptions&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AllowCtrlC = 1,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IncludeKeyDown = 4,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IncludeKeyUp = 8,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NoEcho = 2&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;For example&lt;br /&gt;&lt;blockquote&gt;&amp;gt; $host.ui.RawUI.ReadKey(12)&lt;br /&gt;a&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VirtualKeyCode&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Character&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ControlKeyState&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; KeyDown&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -------&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 65&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 262176&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Just to remind you, my &lt;a href=&quot;http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=ce09cdaf-7da2-4f1c-bed3-f8cb35de5aea&quot;&gt;PowerShell Remoting&lt;/a&gt; remote host implemented all Host, UI and RawUI. So feel free to explore those interesting API on you remote host.&lt;br /&gt;&lt;br /&gt;Have Fun&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/115492091258094974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/08/do-you-know-there-is-host-variable.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115492091258094974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115492091258094974'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/08/do-you-know-there-is-host-variable.html' title='Do You Know There is a $Host Variable'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-115327887308071933</id><published>2006-07-18T23:11:00.000-04:00</published><updated>2006-07-21T15:03:10.723-04:00</updated><title type='text'>Runspace Remoting</title><content type='html'>&lt;a href=&quot;http://www.hanselman.com/&quot;&gt;Scott Hanselman&lt;/a&gt; is one of the early users and supporters of my PowerShell Remoting. He did an interesting post about &lt;a href=&quot;http://www.hanselman.com/blog/ScriptBlockAndRunspaceRemotingInPowerShell.aspx&quot;&gt;Runspace Remoting&lt;/a&gt;. Briefly, he used export-clixml to serialize objects at server and used import-clixml to reconstruct PSObject at client. &lt;a href=&quot;http://mshforfun.blogspot.com/2006/03/securely-extend-monad-pipline-over.html&quot;&gt;I have tried similar mechanism and failed&lt;/a&gt;. Actually &lt;a href=&quot;http://www.blogger.com/comment.g?blogID=20327311&amp;amp;postID=114383256894350753&quot;&gt;Karl Prosser and I have been talking about using export-clixml/import-clixml&lt;/a&gt; a while ago . Great job, Scott!&lt;br /&gt;&lt;br /&gt;Despite of my failure on serialization/de-serialization of PSObject, there is other reasons made me choose &lt;b&gt;user interface remoting&lt;/b&gt;:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href=&quot;http://mshforfun.blogspot.com/2006/03/securely-extend-msh-host-user.html&quot;&gt;Monad was designed to capable of user interface remoting&lt;/a&gt;. Monad engine will manage to display and format (out-default) remote objects. Monad engine can even truncate objects collection for you if there are too many objects in the pipline. &lt;/li&gt;&lt;li&gt;Not all tasks require local objects exactly matching remote objects. For most remote scripting tasks, user interface remoting is good enough. User interface remoting deliver similar user experience as local shell. SSHD already proved itself successful story by similar mechanism.&amp;nbsp; &lt;/li&gt;&lt;li&gt;User can manipulate &quot;Real&quot; remote objects via user interface remoting (No &quot;&lt;i&gt;&lt;b&gt;Heisenberg Uncertainly Principle of PowerShell&lt;/b&gt;&lt;/i&gt;&quot;).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Serialization/de-serialization method has its own limitations.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;It can use a lot of resources and band-width. Consider the situation when multiple runspace ouput huge collection of objects at the same time, even with proper threading management server could still be overloaded. &lt;br /&gt;&lt;/li&gt;&lt;li&gt;What if you just need one simple property of an object with hundreds or thounds of properties, you would have to serialize all public properties of that object and transfer it to client.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;It can loose some property associate with original objects.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&quot;Clustering&quot; multiple servers is possible with user interface remoting. I am trying to &quot;fork&quot; single client input to multiple servers by simply add current client component to server component. (There are still some problems with this model)&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;PS: To Monad Team, a public helper API to serialize PSObject to string will be really helpful.&lt;br /&gt;&lt;br /&gt;Have Fun&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/115327887308071933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/07/runspace-remoting.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115327887308071933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115327887308071933'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/07/runspace-remoting.html' title='Runspace Remoting'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-115284981527507634</id><published>2006-07-13T23:51:00.000-04:00</published><updated>2006-07-14T00:03:35.286-04:00</updated><title type='text'>How to: Using PowerShell through SSH</title><content type='html'>It is possible to use PowerShell through SSH. Read &lt;a href=&quot;http://hivearchive.com/2006/07/03/using-powershell-through-ssh/&quot;&gt;the story from The Hive Archive&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;But there are certain limitations:&lt;br /&gt;1. You have to install cygwin, sshd and ssh client like putty (Well I can certainly live with that. Actually they are always on my hard drive). &lt;br /&gt;2. No prompt&lt;br /&gt;3. some Raw UI might not work&lt;br /&gt;&lt;br /&gt;I am really looking forward to the new version of PowerShell with buildin Remoting function. According to Jeffrey Snover : &lt;em&gt;Our plans for remoting are to leverage WS-MGMT the remoting protocol recently standardized through the DMTF&lt;/em&gt;. &lt;br /&gt;&lt;br /&gt;Have Fun&lt;br /&gt;&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/115284981527507634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/07/how-to-using-powershell-through-ssh.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115284981527507634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115284981527507634'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/07/how-to-using-powershell-through-ssh.html' title='How to: Using PowerShell through SSH'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-115276202311148291</id><published>2006-07-12T23:37:00.000-04:00</published><updated>2006-07-14T21:54:19.243-04:00</updated><title type='text'>Why There Is an Out-Default Cmdlet</title><content type='html'>PowerShell have a couple of output control cmdlets:&lt;br /&gt;&lt;blockquote&gt;&amp;gt; gcm out-*&lt;br /&gt;&lt;br /&gt;CommandType&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Definition&lt;br /&gt;-----------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------&lt;br /&gt;Cmdlet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out-Default&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out-Default [-InputObject &amp;lt;P...&lt;br /&gt;Cmdlet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out-File&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out-File [-FilePath] &amp;lt;String...&lt;br /&gt;Cmdlet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out-Host&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out-Host [-Paging] [-InputOb...&lt;br /&gt;Cmdlet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out-Null&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out-Null [-InputObject &amp;lt;PSOb...&lt;br /&gt;Cmdlet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out-Printer&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out-Printer [[-Name] &amp;lt;String...&lt;br /&gt;Cmdlet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out-String&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out-String [-Stream] [-Width...&lt;br /&gt;&lt;/blockquote&gt;Out-Default cmdlet is one of the most mysterious one.&lt;br /&gt;&lt;blockquote&gt;&amp;gt; help out-default&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out-Default&lt;br /&gt;&lt;br /&gt;SYNOPSIS&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The default controller of output.&lt;br /&gt;&lt;br /&gt;DETAILED DESCRIPTION&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The standard treatment at the end of a pipeline is to send all objects to o&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ut-default.&amp;nbsp; Out-default then sends them all to format-default. It takes th&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; e objects that return and sends them to the default destination.&amp;nbsp; For this&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reason, it is functionally equivalent to out-host but is not called from th&lt;br /&gt;e console.&lt;br /&gt;&lt;/blockquote&gt;The help message does not help at all. Luckily enough, &lt;a href=&quot;http://blogs.msdn.com/powershell/archive/2006/04/30/586973.aspx&quot;&gt;Jeffrey Snover has a blog entry&lt;/a&gt; talking about this cmdlet.&amp;nbsp; In summary, It will &quot;figure out how to format and output the object stream&quot; and send them to host via Out-host cmdlet.&lt;br /&gt;&lt;br /&gt;Here is my two cents:&lt;br /&gt;1. Out-Default cmdlet is &lt;b&gt;NOT&lt;/b&gt; for interactive console User. &lt;br /&gt;Every interactive command from console will have Out-Default appended automatically by Monad engine. Add Out-Default in the middle of pipline could even cause unexpected output.&lt;br /&gt;&lt;blockquote&gt;&amp;gt; gps | format-table&lt;br /&gt;&amp;gt; gps | out-default | format-table&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # format-table will not work.&lt;br /&gt;&lt;/blockquote&gt;2. Out-Default cmdlet is for Monad hosting application.&lt;br /&gt;To have a full-blown Monad hosting application, you have to create your own &quot;Host&quot; (System.Management.Automation.Host.PSHost) which implement interface to process output (If you don&#39;t have your PSHost output interface implemented, your will get an exception when Out-default finally called out-host.). Every interactive command from user input should have Out-Default appended. Then the output of user command were assessed by out-default, formatted by format-* cmdlet, and eventually sent to user interface by out-host cmdlet. &lt;br /&gt;&lt;blockquote&gt;using System.Management.Automation;&lt;br /&gt;using System.Management.Automation.Host;&lt;br /&gt;using System.Management.Automation.Runspaces;&lt;br /&gt;&lt;br /&gt;namespace HostingExample&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;class TestHost&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;static void Main(string[] args)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;string command = &quot;gps&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;PSHost myhost = new MyHost(); &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Runspace myRunspace = RunspaceFactory.CreateRunspace(myhost);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;myRunspace.Open();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Pipeline pipeline1 = myRunspace.CreatePipeline(command, true);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;pipeline1.Commands[0].MergeMyResults(PipelineResultTypes.Error, PipelineResultTypes.Output);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;pipeline1.Commands.Add(&quot;out-default&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Pipeline1.Invoke();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Class MyHost : PSHost&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // MyHost class should be derived from PSHost abstract class. &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;Although you don&#39;t have to (and probably should not) type &quot;Out-Default&quot; at the end of your command, it is always there working for you. Given this reason, Out-Default cmdlet is registered and loaded as default cmdlets.&lt;br /&gt;&lt;br /&gt;You see it is there, you do not use it, but it is definitely important.&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/115276202311148291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/07/why-there-is-out-default-cmdlet.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115276202311148291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115276202311148291'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/07/why-there-is-out-default-cmdlet.html' title='Why There Is an Out-Default Cmdlet'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-115189679421169112</id><published>2006-07-02T23:17:00.000-04:00</published><updated>2006-07-02T23:19:54.230-04:00</updated><title type='text'>Naive and Generic Object Collections in Powershell</title><content type='html'>I believed that you must have dealt with collections in Powershell Scriting. PowerShell has a nice way to support naive object array (object[]):&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;gt;$a = 1,2,3&amp;nbsp;&amp;nbsp; #comma were interpreted as object[]&lt;br /&gt;&amp;gt;$a.gettype().AssemblyQualifiedName&lt;br /&gt;&lt;font color=&quot;#ff0000&quot;&gt;System.Object[]&lt;/font&gt;, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;br /&gt;&lt;br /&gt;&amp;gt;$a= 1..10&amp;nbsp;&amp;nbsp; # .. were interpreted as continuous filled object[]&lt;br /&gt;&amp;gt;$a.gettype().AssemblyQualifiedName&lt;br /&gt;&lt;font color=&quot;#ff0000&quot;&gt;System.Object[]&lt;/font&gt;, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;br /&gt;&lt;/blockquote&gt;For naive object ArrayList/stack/Queue, you have to use new-object cmdlet&lt;br /&gt;&lt;blockquote&gt;&amp;gt; $a = new-object System.Collections.Stack&lt;br /&gt;&amp;gt; $a.GetType().AssemblyQualifiedName&lt;br /&gt;System.Collections.Stack, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKey&lt;br /&gt;Token=b77a5c561934e089&lt;br /&gt;&amp;gt; $a.Push($([System.Net.IPAddress] &quot;192.168.0.1&quot;))&lt;br /&gt;&lt;/blockquote&gt;Most of time, you are fine with naive object model because PowerShell will do the type conversion for you. &lt;br /&gt;&lt;blockquote&gt;&amp;gt;$a= 1..10&lt;br /&gt;&amp;gt;$a |gm&lt;br /&gt;&amp;nbsp;&amp;nbsp; TypeName: &lt;font color=&quot;#ff0000&quot;&gt;System.Int32&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MemberType Definition&lt;br /&gt;----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------- ----------&lt;br /&gt;CompareTo&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32 CompareTo(Int32 value), System.Int32 Com...&lt;br /&gt;Equals&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean Equals(Object obj), System.Boolean Equ...&lt;br /&gt;GetHashCode Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32 GetHashCode()&lt;br /&gt;GetType&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Type GetType()&lt;br /&gt;GetTypeCode Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.TypeCode GetTypeCode()&lt;br /&gt;ToString&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String ToString(), System.String ToString(IFor...&lt;br /&gt;&lt;/blockquote&gt;But sometimes it is not good enough. You probably want to use generic object model. &lt;br /&gt;&lt;br /&gt;For generic array (like System.Net.IPAddress[]), it requires a conversion:&lt;br /&gt;&lt;blockquote&gt;&amp;gt;$a = ($([System.Net.IPAddress] &quot;192.168.0.1&quot;),$([System.Net.IPAddress] &quot;127.0.0.1&quot;) )&lt;br /&gt;&amp;gt;$a.gettype().AssemblyQualifiedName&lt;br /&gt;&lt;font color=&quot;#ff0000&quot;&gt;System.Object[]&lt;/font&gt;, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;br /&gt;&amp;gt;$b= [System.Net.IPAddress[]] $a&lt;br /&gt;&amp;gt; $b.GetType().AssemblyQualifiedName&lt;br /&gt;&lt;font color=&quot;#ff0000&quot;&gt;System.Net.IPAddress[]&lt;/font&gt;, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;br /&gt;&lt;/blockquote&gt;For generic collection (like System.Collections.ObjectModel.Collection&amp;lt;System.Net.IPAddress&amp;gt;), it becomes a little nasty (it requires Assembly Qualified Name) :&lt;br /&gt;&lt;blockquote&gt;&amp;gt;$a = New-Object System.Collections.ObjectModel.Collection&quot;`1[[System.Net.IPAddress, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]&quot;&lt;br /&gt;&amp;gt; $a.GetType().AssemblyQualifiedName&lt;br /&gt;System.Collections.ObjectModel.Collection`1[[System.Net.IPAddress, System, Vers&lt;br /&gt;ion=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Vers&lt;br /&gt;ion=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;br /&gt;&amp;gt; $a.Add($([System.Net.IPAddress] &quot;192.168.0.1&quot;))&lt;br /&gt;&lt;/blockquote&gt;What about generic Stack?&lt;br /&gt;&lt;blockquote&gt;&amp;gt; $a = New-Object System.Collections.Generic.Stack&quot;`1[[System.Net.IPAddres&lt;br /&gt;s, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]&quot;&lt;br /&gt;&amp;gt; $a.GetType().AssemblyQualifiedName&lt;br /&gt;System.Collections.Generic.Stack`1[[System.Net.IPAddress, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;br /&gt;&amp;gt; $a.Push($([System.Net.IPAddress] &quot;192.168.0.1&quot;))&lt;br /&gt;&amp;gt; $a.pop()&lt;br /&gt;IPAddressToString : 192.168.0.1&lt;br /&gt;Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 16820416&lt;br /&gt;AddressFamily&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : InterNetwork&lt;br /&gt;ScopeId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&lt;br /&gt;IsIPv6Multicast&amp;nbsp;&amp;nbsp; : False&lt;br /&gt;IsIPv6LinkLocal&amp;nbsp;&amp;nbsp; : False&lt;br /&gt;IsIPv6SiteLocal&amp;nbsp;&amp;nbsp; : False&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Have Fun&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/115189679421169112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/07/naive-and-generic-object-collections.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115189679421169112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115189679421169112'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/07/naive-and-generic-object-collections.html' title='Naive and Generic Object Collections in Powershell'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-115163798628441993</id><published>2006-06-29T23:18:00.000-04:00</published><updated>2006-06-29T23:26:26.300-04:00</updated><title type='text'>PowerShell Remoting version 0.2.7.1</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://photos1.blogger.com/blogger/5412/2034/1600/client1.3.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;http://photos1.blogger.com/blogger/5412/2034/320/client1.3.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://photos1.blogger.com/blogger/5412/2034/1600/client2.1.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;http://photos1.blogger.com/blogger/5412/2034/320/client2.1.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://photos1.blogger.com/blogger/5412/2034/1600/client3.1.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;http://photos1.blogger.com/blogger/5412/2034/320/client3.1.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=ce09cdaf-7da2-4f1c-bed3-f8cb35de5aea&quot;&gt;Download here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;font color=&quot;red&quot;&gt;Uninstall old version of PowerShell Remoting before install newer version.&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;New GUI client manager: Save/delete server information &amp;amp; connection option,  generate connection script automatically, launch powershell remoting client  directly.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Add option to reject connection if user found invalid remote X509 certificate.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Bug fix: Null login credential (press Cancel in CredUI window) cause server  crash and client throw Null reference exception. &lt;/li&gt;&lt;br /&gt;&lt;li&gt;Bug fix: other minor bugs&lt;/li&gt;&lt;/ol&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Check out the help.chm in release package for details.&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;Have Fun&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/115163798628441993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/06/powershell-remoting-version-0271.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115163798628441993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115163798628441993'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/06/powershell-remoting-version-0271.html' title='PowerShell Remoting version 0.2.7.1'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-115103355513937622</id><published>2006-06-22T23:27:00.000-04:00</published><updated>2006-06-26T14:42:18.080-04:00</updated><title type='text'>Enter Nested Prompt function</title><content type='html'>In windows PowerShell, $Host object provides direct access to some important APIs. One of the interesting functions is &lt;b&gt;$Host.EnterNestedPrompt()&lt;/b&gt;. Frankly speaking, it did not appeal to me at all when I first tried it. But I discovered this beauty after I implemented my own PSHost&amp;nbsp; in &lt;a href=&quot;http://www.gotdotnet.com/workspaces/workspace.aspx?id=ce09cdaf-7da2-4f1c-bed3-f8cb35de5aea&quot;&gt;PowerShell Remoting&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;What did it do?&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Suspend &amp;amp; Save current execution context state. &lt;/li&gt;&lt;li&gt;Create a new nested execution context.(Nested pipline, new prompt execution helper and new script excution helper)&lt;/li&gt;&lt;li&gt;Push the new nested execution context to stack. (PowerShell use a static stack. In my PowerShell Remoting, it is more complicate. Every client has its own host; every host has its own stack for nested prompt.)&lt;/li&gt;&lt;li&gt;Increase &lt;b&gt;$NESTEDPROMPTLEVEL&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;That is to say:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Your current pipeline is suspended. All variables and errors state were saved. &lt;/li&gt;&lt;li&gt;In the meantime, you still have access to monad engine. You can have new prompt, run new script or other interactive command.&lt;/li&gt;&lt;li&gt;When you are done with the new scope, you can call invoke $Host.ExitNestedPrompt()&amp;nbsp; or &quot;exit&quot; (which will call $Host.ExitNestedPrompt())&amp;nbsp; to return to previous pipeline. &lt;/li&gt;&lt;/ol&gt;What can I do with it?&lt;br /&gt;&lt;ol&gt;&lt;li&gt;First, Let&#39;s see how &quot;&lt;b&gt;Suspend&lt;/b&gt;&quot; works when using &lt;font color=&quot;#ff0000&quot;&gt;-confirm option&lt;/font&gt; or &quot;&lt;font color=&quot;#ff0000&quot;&gt;Set-PSDebug -Step&lt;/font&gt;&quot;&lt;/li&gt;&lt;blockquote&gt;&amp;gt; kill 2804 -Confirm&lt;br /&gt;&lt;br /&gt;Confirm&lt;br /&gt;Are you sure you want to perform this action?&lt;br /&gt;Performing operation &quot;Stop-Process&quot; on Target &quot;Notepad (2804)&quot;.&lt;br /&gt;[Y] Yes&amp;nbsp; [A] Yes to All&amp;nbsp; [N] No&amp;nbsp; [L] No to All&amp;nbsp; [S] Suspend&amp;nbsp; [?] Help&lt;br /&gt;(default is &quot;Y&quot;):&lt;br /&gt;&lt;br /&gt;&amp;gt; Set-PSDebug -Step&lt;br /&gt;&amp;gt; D:\ps1\special.ps1&lt;br /&gt;&lt;br /&gt;Continue with this operation?&lt;br /&gt;&amp;nbsp;&amp;nbsp; 1+ D:\ps1\special.ps1&lt;br /&gt;[Y] Yes&amp;nbsp; [A] Yes to All&amp;nbsp; [N] No&amp;nbsp; [L] No to All&amp;nbsp; [S] Suspend&amp;nbsp; [?] Help&lt;br /&gt;(default is &quot;Y&quot;):&lt;br /&gt;&lt;/blockquote&gt;When you choose [S]Suspend, you actually called $Host.EnterNestedPrompt() which break current script and provide you an nested prompt.&lt;br /&gt;&lt;li&gt;Secondly, $Host.EnterNestedPrompt() can be used as break point when debugging your script. &lt;/li&gt;To make a break point, you can add $Host.EnterNestedPrompt() at anywhere in your script. When your script execute to it, you will have a nested prompt to explore variables and errors at this break point.&lt;br /&gt;&lt;blockquote&gt;&amp;gt; 1..10 | %{if($_ -eq 5) {$host.EnterNestedPrompt()};$_}&lt;br /&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; $_&lt;br /&gt;5&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; exit&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt;7&lt;br /&gt;8&lt;br /&gt;9&lt;br /&gt;10&lt;/blockquote&gt;&lt;/ol&gt;Be careful&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Nested prompt and original prompt share same variables provider. So when you change a variable in nested prompt, the change will remain effective in original prompt.&lt;/li&gt;&lt;li&gt;Comannd will be written in history when it is completed. So a suspended command will not be found in history. &lt;br /&gt;&lt;/li&gt;&lt;li&gt;The maximum depth of nested prompt level ($NESTEDPROMPTLEVEL) is 128. So always check $NESTEDPROMPTLEVEL for current nested prompt level. You can write it into your prompt function.&lt;/li&gt;&lt;li&gt;Do not try to make a nested function using $Host.EnterNestedPrompt(). But you can always do this.&lt;/li&gt;&lt;blockquote&gt;function factorial&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; param ([int]$n = 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($n -le 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;Invalid parameter.&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($n -eq 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $n * (factorial ($n-1))&lt;br /&gt;}&lt;/blockquote&gt;&lt;/ol&gt;Reference: &lt;a href=&quot;http://blogs.msdn.com/monad/archive/2006/04/15/576996.aspx&quot;&gt;Start-NewScope&lt;/a&gt;&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/115103355513937622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/06/enter-nested-prompt-function.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115103355513937622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115103355513937622'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/06/enter-nested-prompt-function.html' title='Enter Nested Prompt function'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-115012747838106576</id><published>2006-06-12T11:30:00.000-04:00</published><updated>2006-06-12T11:52:09.456-04:00</updated><title type='text'>What Access Rights Do You Have?</title><content type='html'>A PowerShell script to check User/Group access rights on FileSystem and Registry.&lt;br /&gt;&lt;br /&gt;Yesterday, I was reading post on Mark&#39;s Sysinternals Blog: &lt;a href=&quot;http://www.sysinternals.com/blog/2006/05/power-in-power-users.html&quot;&gt;The Power in Power Users&lt;/a&gt;. It says &quot;&lt;b&gt;a user that belongs to the Power Users group can easily elevate themselves to fully-privileged administrators&lt;/b&gt;&quot;. He used a tool called &lt;b&gt;AccessChk&lt;/b&gt; to find out what access rights does &quot;Power User&quot; group have. &lt;br /&gt;&lt;br /&gt;If you read my serise posts on &lt;a href=&quot;http://mshforfun.blogspot.com/2006/01/combination-rights-inheritance-and.html&quot;&gt;access control list in monad&lt;/a&gt;.&amp;nbsp; you will find out that we can get/set access rule in PowerShell directly without using extra tools. So I wrote a PowerShell script (Check-AccessRights.ps1) to get similar function as AccessChk. It is pretty dirty, but dose the job. You may want to try&lt;br /&gt;&lt;blockquote&gt;D:\ps1\Check-AccessRights.ps1 .\ &lt;br /&gt;# Check your access rights on current path (could be filesystem or registry)&lt;br /&gt;&lt;/blockquote&gt;or&lt;br /&gt;&lt;blockquote&gt;D:\ps1\Check-AccessRights.ps1 HKLM:\sytem\CurrentControlSet\Services $true &quot;Power Users&quot;&lt;br /&gt;# HKLM:\sytem\CurrentControlSet\Services is Path to check&lt;br /&gt;# $true is to get child object ACL recursively&lt;br /&gt;# &quot;Power Users&quot; is user/group&lt;br /&gt;&lt;/blockquote&gt;Be prepared if you use -Recurse option ($true), you may want to redirect results to a file.&lt;br /&gt;&lt;blockquote&gt;#################################################################&lt;br /&gt;#&lt;br /&gt;# File: Check-AccessRights.ps1&lt;br /&gt;# Author: Tony (http://MSHForFun.blogspot.com/)&lt;br /&gt;# Parameters:&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; $Path:&amp;nbsp; PowerShell Path (for example, c:\ or HKLM:\)&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; $Recurse: Check child object recursively&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; $Account: User name / Group (for example, &quot;domain\alice&quot;, &lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;Power Users&quot;)&lt;br /&gt;#&lt;br /&gt;################################################################&lt;br /&gt;param([string] $Path = {throw &quot;Please specify a path&quot;}, [bool] $Recurse = $false, [string] $Account)&lt;br /&gt;if (-not (test-path $Path))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Path + &quot; not exists!&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;br /&gt;}&lt;br /&gt;if ([string]::ISNullOrEmpty($Account))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $SID = ([System.Security.Principal.WindowsIdentity]::GetCurrent()).Owner&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $SID = (new-object System.Security.Principal.NTAccount($Account)).Translate([System.Security.Principal.SecurityIdentifier])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($SID -eq $null) {return}&lt;br /&gt;}&lt;br /&gt;&quot;Account: &quot; + $SID.ToString()&lt;br /&gt;&quot;Path: &quot; + $Path&lt;br /&gt;$AccessRules = (get-acl $Path).Access&lt;br /&gt;if ($AccessRules -eq $null)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;Can&#39;t get access rules!&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;br /&gt;}&lt;br /&gt;$AccessRules|foreach-object {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CurrentSID = $_.IdentityReference.Translate([System.Security.Principal.SecurityIdentifier])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($CurrentSID.ToString() -eq $SID.ToString())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $_&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;} &lt;br /&gt;if ($Recurse)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-ChildItem $Path -Recurse| foreach {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;========================================&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;Child Path: &quot; + $_.ToString()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $AccessRules = (get-acl $Path).Access&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($AccessRules -eq $null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;Can&#39;t get access rules!&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $AccessRules|foreach-object {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CurrentSID = $_.IdentityReference.Translate([System.Security.Principal.SecurityIdentifier])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($CurrentSID.ToString() -eq $SID.ToString())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $_&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Have Fun&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/115012747838106576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/06/what-access-rights-do-you-have.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115012747838106576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/115012747838106576'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/06/what-access-rights-do-you-have.html' title='What Access Rights Do You Have?'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-114973866711629890</id><published>2006-06-07T23:45:00.000-04:00</published><updated>2006-06-07T23:51:07.133-04:00</updated><title type='text'>PowerShellIDE: the Good, the Bad and the Ugly</title><content type='html'>&lt;a href=&quot;http://www.powershell.com/&quot;&gt;PowerShellIDE&lt;/a&gt;? Yes, an IDE for PowerShell! Oh, boy! That&#39;s a whole lot fun. If you like PowerShell, you should try this out.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The good&lt;/b&gt;:&lt;br /&gt;It is advertised (it is free at this moment) as &quot;&lt;b&gt;The World&#39;s First PowerShell Editor&lt;/b&gt;&quot; (what is &quot;PowerShell Analyzer&quot; then?) and wrapped in a dazzling GUI (you should really checkout its Mac style chooser). &lt;br /&gt;&lt;br /&gt;You got intellisense functionality, a debugger, variable explorer and properties window. &lt;br /&gt;&lt;br /&gt;You can set up a breakpoint in your script and checkout pipline in a GUI environment. &lt;br /&gt;&lt;br /&gt;It is the first GUI Monad hosting application I have seen which can handle legacy console application (like ping.exe or netshe.exe)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The bad&lt;/b&gt;:&lt;br /&gt;1. Not yet implemented.&lt;br /&gt;You&#39;d better forgot about following API:&lt;br /&gt;Read-host -AsSecureString (ReadLineAsSecureString)&lt;br /&gt;PromptForCredential&lt;br /&gt;SetBufferContents&lt;br /&gt;Getbuffercontents&lt;br /&gt;&lt;br /&gt;2. It is not the same!&lt;br /&gt;Don&#39;t expect same user experience with&lt;br /&gt;Write-progress&lt;br /&gt;$host.UI.ReadLine() (Oops, Popup window)&lt;br /&gt;$host.UI.RawUI.ReadKey() &lt;br /&gt;&lt;br /&gt;&lt;b&gt;The ugly&lt;/b&gt;:&lt;br /&gt;PowerShellIDE has to be run under Administrator account. This is killing me. Come on, men! Why it has to read prefetch?&lt;br /&gt;&lt;blockquote&gt;PowerShellIDE.E:3300&amp;nbsp;&amp;nbsp; &amp;nbsp;OPEN&amp;nbsp;&amp;nbsp; &amp;nbsp;C:\WINDOWS\Prefetch\POWERSHELLIDE.EXE-3628D30E.pf&amp;nbsp;&amp;nbsp; &amp;nbsp;ACCESS DENIED&lt;br /&gt;&lt;/blockquote&gt;&lt;b&gt;Some other thoughts&lt;/b&gt;:&lt;br /&gt;I came across someone&#39;s post (I forgot where) talking about PowerShell: &quot;This thing is for Programmer.&quot; Now, we have an IDE for PowerShell. It again prove &quot;This thing is for Programmer.&quot; Remember the famous joke about Microsoft Visual Studio:&quot; The IDE is so good and you were having so much fun with it. Eventually you forgot what you were doing.&quot; This is exactly what happened here:&lt;br /&gt;&lt;br /&gt;Despite of intellisense, the entire &quot;breakpoint, pipline reader and properties&quot; thing can be done in PowerShell.exe command line directly. Just add &quot;&lt;font color=&quot;#ff0000&quot;&gt;&lt;b&gt;$host.EnterNestedPrompt()&lt;/b&gt;&lt;/font&gt;&quot; in my script, I can get current pipline status, explore properties as I wish. But in the windows world, everyone indulged themselves to the IDE thing. People always try to find an IDE desperately even there is no need for that. I bet those guys from &quot;&lt;span style=&quot;font-weight:bold;&quot;&gt;slash dot&lt;/span&gt;&quot; will laugh at us again.&lt;br /&gt;&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/114973866711629890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/06/powershellide-good-bad-and-ugly.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114973866711629890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114973866711629890'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/06/powershellide-good-bad-and-ugly.html' title='PowerShellIDE: the Good, the Bad and the Ugly'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-114956886812693818</id><published>2006-06-06T00:25:00.000-04:00</published><updated>2006-06-06T00:41:08.340-04:00</updated><title type='text'>PowerShell Remoting version 0.2.6.0</title><content type='html'>&lt;div style=&quot;clear: both;&quot;&gt;&lt;/div&gt;&lt;a href=&quot;http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=ce09cdaf-7da2-4f1c-bed3-f8cb35de5aea&quot;&gt;Download here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;font color=&quot;red&quot;&gt;Uninstall old version of PowerShell Remoting before install newer version.&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Write Server Information &amp;amp; Error to EventLog (Source: PowerShellRemoting).  Log file will no longer be used by newer version.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;SSL support using SSLStream.&lt;/li&gt;&lt;br /&gt;&lt;font color=&quot;#ff0000&quot;&gt;Warning: SSL is for advanced user.&lt;/font&gt; &lt;br /&gt;If you want to provide SSL support to server, you should&lt;br /&gt;&lt;ul&gt; &lt;br /&gt;&lt;li&gt;Get X509 certificate for server. For testing purpose, you can use makecert.exe (included in .NET framework SDK) &lt;br /&gt;&lt;/li&gt;&lt;li&gt;Install X509 certificate at StoreLocation: LocalMachine, StoreName: My (personal). &lt;br /&gt;&lt;/li&gt;&lt;li&gt;Grand &quot;NetworkService&quot; account read access to X509 certificate associated private key file. &lt;br /&gt;&lt;/li&gt;&lt;li&gt;Set [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PowerShellRemoting\Parameters\ X509] to thumbprint of X509 Certificate.&lt;br /&gt;&lt;br /&gt;There is pretty good walkthrough at &lt;a href=&quot;http://blogs.technet.com/jhoward/archive/2005/02/02/365323.aspx&quot;&gt;John Howard&#39;s blog&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;li&gt;X509 Option &lt;/li&gt;&lt;br /&gt;[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PowerShellRemoting\Parameters]&lt;br /&gt;&quot;X509&quot;=&quot;0&quot;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;DebugHost Option (Default 0: false)&lt;/li&gt;&lt;br /&gt;[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PowerShellRemoting\Parameters]&lt;br /&gt;&quot;DebugHost&quot;=dword:00000000 &lt;br /&gt;&lt;br /&gt;&lt;li&gt;Bug fix: Write-Progress throw null object Exception.&lt;/li&gt;&lt;/ol&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Check out the help.chm in release package for details.&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;Have Fun&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/114956886812693818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/06/powershell-remoting-version-0260.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114956886812693818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114956886812693818'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/06/powershell-remoting-version-0260.html' title='PowerShell Remoting version 0.2.6.0'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-114904804238664260</id><published>2006-05-30T23:56:00.000-04:00</published><updated>2006-05-31T00:00:42.400-04:00</updated><title type='text'>Download Gene Sequences Using NCBI eFetch Tools</title><content type='html'>Recently, I was working on a bioinformatics research project which needed to download hundreds of gene mRNA sequences. I have all the gene IDs in one text file. So a simple PowerShell Script could solve my problem.&lt;br /&gt;&lt;br /&gt;I have a &lt;a href=&quot;http://mshforfun.blogspot.com/2006/01/author-monad-cmdlet-as-web-service.html&quot;&gt;old post talking about NCBI Entrez eUtils tools&lt;/a&gt;. Today, I will use the &lt;font color=&quot;#ff0000&quot;&gt;&lt;b&gt;eFetch&lt;/b&gt;&lt;/font&gt; tool (also included in eUtils). The script is simple and self-explaining.&lt;br /&gt;&lt;blockquote&gt;# ===========================================================================&lt;br /&gt;#&lt;br /&gt;# Author:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Tony (http://MSHForFun.blogspot.com)&lt;br /&gt;# File:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Efetch.ps1&lt;br /&gt;# Description: Download gene sequences using NCBI eUtils.eFetch tool&lt;br /&gt;# Reference: http://eutils.ncbi.nlm.nih.gov/entrez/query/static/eutils_example.pl&lt;br /&gt;# Reference: http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetch_help.html&lt;br /&gt;# Reference: http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetchseq_help.html&lt;br /&gt;#&amp;nbsp; &lt;br /&gt;# ===========================================================================&lt;br /&gt;param&lt;br /&gt;(&lt;br /&gt;&amp;nbsp; [string] $Path=$(throw &quot;Please Specify a file&quot;)&lt;br /&gt;)&lt;br /&gt;$BaseURL = &quot;http://www.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&amp;amp;id=&quot;&lt;br /&gt;$Option= &quot;&amp;amp;rettype=fasta&amp;amp;retmode=text&quot;&lt;br /&gt;$WebClient = new-object System.Net.WebClient&lt;br /&gt;$SavePath = $Path + &quot;.result&quot;&lt;br /&gt;if (test-path $savePath)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; del $SavePath&lt;br /&gt;}&lt;br /&gt;foreach ( $id in (get-content $path))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; # Construct eFetch URL&lt;br /&gt;&amp;nbsp; $URL=$BaseURL + $id + $Option&lt;br /&gt;&amp;nbsp; Write-Progress -Activity &quot;Download Sequences&quot; -Status &quot;Submit gene $Id&quot;&lt;br /&gt;&amp;nbsp; # Submit and download data&lt;br /&gt;&amp;nbsp; $Data = $WebClient.DownloadString($URL)&lt;br /&gt;&amp;nbsp; # Parse Data&lt;br /&gt;&amp;nbsp; if ($Data.Length -gt 1)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Progress -Activity &quot;Download Sequences&quot; -Status &quot;$id OK&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Write to Console&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $data&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Wrtie To file&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $data &amp;gt;&amp;gt; $SavePath&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; else&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Progress -Activity &quot;Download Sequences&quot; -Status &quot;$Id is not found!&quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;$Id is not found!`n`r&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;$Id is not found!`n`r&quot; &amp;gt;&amp;gt; $SavePath&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; # Try not to overload NCBI Server&lt;br /&gt;&amp;nbsp; start-sleep 1&lt;br /&gt;}&lt;br /&gt;# Clear Progress pane&lt;br /&gt;Write-Progress -Activity &quot;Download Sequences&quot; -Status &quot;Done&quot; -completed &lt;br /&gt;&lt;/blockquote&gt;You need a text file (genes.txt) to test this script:&lt;br /&gt;&lt;blockquote&gt;0&lt;br /&gt;NM_008176&lt;br /&gt;NM_009140&lt;br /&gt;NM_009141&lt;br /&gt;NM_011333&lt;br /&gt;NM_013654&lt;br /&gt;NM_016960&lt;br /&gt;NM_009142&lt;br /&gt;NM_008491&lt;br /&gt;NM_031168&lt;br /&gt;NM_009883&lt;br /&gt;NM_007679&lt;br /&gt;NM_010030&lt;br /&gt;NM_009971&lt;br /&gt;NM_010809&lt;br /&gt;NM_008607&lt;br /&gt;NM_030612&lt;br /&gt;NM_011198&lt;br /&gt;NM_007987&lt;br /&gt;&lt;/blockquote&gt;If you are a biologist, you can see what kind of genes I am intersted in. The first &quot;0&quot; is just to cause an &quot;Not Found&quot; Error. You can run this script like following:&lt;br /&gt;&lt;blockquote&gt;.\efetch.ps1 genes.txt&lt;br /&gt;&lt;/blockquote&gt;Your results is printed to screen as well as &quot;genes.txt.result&quot; file.&lt;br /&gt;&lt;br /&gt;Have Fun&lt;br /&gt;&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/114904804238664260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/05/download-gene-sequences-using-ncbi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114904804238664260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114904804238664260'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/05/download-gene-sequences-using-ncbi.html' title='Download Gene Sequences Using NCBI eFetch Tools'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-114800207482034566</id><published>2006-05-18T21:24:00.000-04:00</published><updated>2006-05-18T21:27:54.836-04:00</updated><title type='text'>PowerShell Remoting, Lock Down</title><content type='html'>Any remote shell application is dangerous because you open a door to outside world. So does PowerShell Remoting. Previous version of PowerShell Remoting totally depended on NegotiateStream. You have no control of login process or you can not limit user access.&amp;nbsp; So anyone with a valid local or domain account can login remotely into your computer. As more and more people began to download and install PowerShell Remoting on their computer, I decided to add client access control policy to PowerShell Remoting.&lt;br /&gt;&lt;br /&gt;Firstly, you should limit maximum number of clients which can connect to server simultaneously. This is done by modify registry:&lt;br /&gt;&lt;blockquote&gt;[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PowerShellRemoting\Parameters]&lt;br /&gt;&quot;MaxClient&quot;=dword:0000000a&lt;br /&gt;&lt;/blockquote&gt;Default value is 10. Given 256MB memory is standard configuration for desktop PC, this number is more than enough if you decided to login to your desktop from home network. You can definitely increase this number if you have more clients but remember each runspace will allocate quite a few of memory. So do some experiment and calculation then you can find a reasonable number. &lt;br /&gt;&lt;br /&gt;Secondly, you should limit maxium number of clients which can connect to server simultaneously from Same IP address. This is done by modify registry:&lt;br /&gt;&lt;blockquote&gt;[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PowerShellRemoting\Parameters]&lt;br /&gt;&quot;MaxClientPerIP&quot;=dword:00000002&lt;br /&gt;&lt;/blockquote&gt;Default value is 2. You can also change that but you don&#39;t want all your available slots of connection were occupied by clients from same computer.&lt;br /&gt;&lt;br /&gt;Thirdly, you may want to limit which user can login from which IP address. This is done by modify &lt;br /&gt;&lt;b&gt;%Program Files%\PowerShell Remoting\user.xml&lt;/b&gt;&lt;br /&gt;Default installation &lt;font color=&quot;#ff0000&quot;&gt;&lt;b&gt;only allow user in Administrators group login from localhost&lt;/b&gt;&lt;/font&gt;. So you have to have your own user.xml before you can login from another IP. If user.xml file parse error occorred when start service, default policy will be loaded. If you can&#39;t login, check log file or EventLog for details of parse error. &lt;br /&gt;User.xml file contain information about your user access control list. It has SEVEN tags:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;&amp;lt;NetworkACL&amp;gt;&lt;/b&gt;: container of one or more access control entry (&amp;lt;NetworkACE&amp;gt;)&lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;NetworkACE&amp;gt;&lt;/b&gt;: access control entry container of &amp;lt;Account&amp;gt;, &amp;lt;Access&amp;gt; and &amp;lt;IPRange&amp;gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;Account&amp;gt;&lt;/b&gt;: Valid Group or User&lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;Access&amp;gt;&lt;/b&gt;:&amp;nbsp; Allow / Deny&lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;IPRange&amp;gt;&lt;/b&gt;: container of &amp;lt;IP&amp;gt; and &amp;lt;Subnet&amp;gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;IP&amp;gt;&lt;/b&gt;: IPAddress. 0.0.0.0 for any IP, 127.0.0.1 for localhost, 192.168.0.2 etc. IPv6 string should be fine, but I have not been able to test it. &lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;Subnet&amp;gt;&lt;/b&gt;: IPv4 subnet. 192.168.0.0/255.255.255.0 or CIDR like format 192.168.0.0/24.&lt;/li&gt;&lt;/ol&gt;Within &amp;lt;NetworkACE&amp;gt; and &amp;lt;/NetworkACE&amp;gt; tags, order matters. &lt;br /&gt;&lt;ol&gt;&lt;li&gt;&amp;lt;Account&amp;gt;&lt;/li&gt;&lt;li&gt;&amp;lt;Access&amp;gt;&lt;/li&gt;&lt;li&gt;&amp;lt;IPRange&amp;gt;&lt;/li&gt;&lt;/ol&gt;Within &amp;lt;IPRange&amp;gt; and &amp;lt;/IPRange&amp;gt; tags, &amp;lt;IP&amp;gt; and &amp;lt;Subnet&amp;gt; can be used in any order. &lt;br /&gt;As you can probably already figured it out : After user provide credential and got a token (WindowsIdentity), PowerShell Remoting will try to match User/Group and IP range in records of access control list. If no record was found, access is denied. If a records match User/Group and IP range were found, PowerShell Remoting will assess access in following order:&lt;br /&gt;&lt;blockquote&gt;User Deny &amp;gt; User Allow &amp;gt; Group Deny &amp;gt; Group Allow&lt;br /&gt;&lt;/blockquote&gt;For example: if client were a privileged user (Administrators group) from 192.168.0.2, but there were only one record which wanted to deny access of Users group from subnet 192.168.0.0/255.255.255.0. Then access from this client will be denied because any user belongs to Administrators group also belongs to Users group and 192.168.0.2 belongs to subnet 192.168.0.0/255.255.255.0.&lt;br /&gt;&lt;br /&gt;After you logged in and get a PowerShell prompt, you can check $UserACL for serialized access control list.&lt;br /&gt;&lt;br /&gt;Right now, subnet parsing and match could be buggy. So tell me if you found it did not act as expected.&lt;br /&gt;&lt;br /&gt;These changes could make it more difficult to start using PowerShell Remoting. But I believed that you will like them later on. Remember, if you make any changes to previous setting, you will have to restart service to make them take effect.&lt;br /&gt;&lt;blockquote&gt;Stop-Service PowerShellRemoting&lt;br /&gt;Start-Service PowerShellRemoting&lt;br /&gt;&lt;/blockquote&gt;There is also some exciting new feature:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;PowerShell Remoting Client becomes a PSSnapin now. So installation become usier. Just run install.ps1 in client folder and invoke Start-RemoteHost, you are on you way to your remote shell.&lt;/li&gt;&lt;li&gt;Ctrl+C Ctrl+Break support. &lt;br /&gt;&lt;/li&gt;Try&lt;blockquote&gt;dir c:\windows\system32&lt;br /&gt;&lt;/blockquote&gt;And press Ctrl+C to cancel it. If you don&#39;t want to handle Ctrl+C, you can set&lt;br /&gt;&lt;blockquote&gt;$RemotingClient.CanHandleCancelKey = $false &lt;br /&gt;&lt;/blockquote&gt;But you probably do not want to do that.&lt;br /&gt;Ctrl+Break will also quit PowerShell Session. So Use it with caution.&lt;br /&gt;&lt;br /&gt;&lt;li&gt;You will find out that information written in log file has been dramatically reduced because I am going to swith to EventLog in later verion.&lt;/li&gt; &lt;/ol&gt;I can actually run PowerShell Remoting Client with in PowerShell Analyzer. But its ReadLine popup window really bothers me.&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/114800207482034566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/05/powershell-remoting-lock-down.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114800207482034566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114800207482034566'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/05/powershell-remoting-lock-down.html' title='PowerShell Remoting, Lock Down'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-114798687549458582</id><published>2006-05-18T17:05:00.000-04:00</published><updated>2006-05-18T18:49:34.426-04:00</updated><title type='text'>PowerShell Remoting version 0.2.5.1</title><content type='html'>&lt;a href=&quot;http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=ce09cdaf-7da2-4f1c-bed3-f8cb35de5aea&quot;&gt;Version 0.2.5.1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;font color=&quot;red&quot;&gt;Uninstall old version of PowerShell Remoting before install newer version.&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Support Ctrl+C and Ctrl+Break to cancel current pipeline (UDP datagram, So not 100% reliable)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Support Maximum Client per IP option (default 2)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Customized client filter policy (%Program Files%\PowerShell Remoting\user.xml, see sample files for format information)&lt;/li&gt;&lt;br /&gt;   &lt;B&gt;Important&lt;/B&gt;: default installation &lt;font color = &quot;red&quot;&gt;only allow user in Administrators group login from localhost&lt;/font&gt;. So you have to have your own user.xml before you can login from another IP. If user.xml file parse error occorred when start service, default policy will be loaded. Check log file or EventLog for details of parse error. &lt;br /&gt;&lt;br /&gt;&lt;li&gt;$UserACL variable for current client filter policy&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Client is installed as PSSnapin&lt;/li&gt;&lt;br /&gt;&lt;li&gt;New install/uninstall script for both server and client, new start-remotehost.ps1 script&lt;/li&gt;&lt;br /&gt;&lt;li&gt;CanThrowException and CanHandleCancelKey property of client (For developer)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Change Log file path to %Documents and Settings%\NetworkService\Local Settings\Application Data\PowerShellRemoting.log&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Change Service Name to &quot;PowerShellRemoting&quot;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Service related Exception is also Logged to Eventlog (EventLog: Application, source: PowershellRemoting)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Other Bugs fixed&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;Have Fun&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/114798687549458582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/05/powershell-remoting-version-0251.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114798687549458582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114798687549458582'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/05/powershell-remoting-version-0251.html' title='PowerShell Remoting version 0.2.5.1'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-114757504586214835</id><published>2006-05-13T22:47:00.000-04:00</published><updated>2006-05-16T08:42:15.000-04:00</updated><title type='text'>Potential Security Problem of PSSnapin Installation and Execution</title><content type='html'>Windows PowerShell is powerful (hehe, sounds like a bad salesman). To make it even better, user can extent it by &lt;b&gt;PSSnapin&lt;/b&gt;. PSSnapin can contain PSProviders, Cmdlets and other class library. But there is a catch. PSSnapin is arbitrary code which could be bad designed, bugs loaded and somewhat out of your control. If you are not careful when install and execute, PSSnapin can cause serious security problems. Let&#39;s look following example:  &lt;br /&gt;&lt;br /&gt;Supposed you have a PSSnapin:&lt;br /&gt;&lt;blockquote&gt;using System;&lt;br /&gt;using System.ComponentModel;&lt;br /&gt;using System.Management.Automation;&lt;br /&gt;namespace TestSnapin&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [RunInstaller(true)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class MySnapin : PSSnapIn&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override string Name&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return &quot;Test&quot;; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override string Vendor&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return &quot;http://MSHForFun.blogspot.com/&quot;; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override string Description&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return &quot;Test&quot;; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; public class Class2&lt;br /&gt;&amp;nbsp;&amp;nbsp;    {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Who&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return &quot;Good Guy!&quot;; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;You built it by yourself or simply downloaded it from internet. You (&lt;b&gt;An Administrator&lt;/b&gt;) copied it to a folder and ran installutil.exe to install it. Then you tried to use it in PowerShell:&lt;br /&gt;&lt;blockquote&gt;&amp;gt;get-pssnapin -reg&lt;br /&gt;&lt;br /&gt;Name        : Test&lt;br /&gt;PSVersion   : 1.0&lt;br /&gt;Description : Test&lt;br /&gt;&lt;br /&gt; &amp;gt; add-pssnapin test&lt;br /&gt; &amp;gt; $a = new-object TestSnapin.Class2&lt;br /&gt; &amp;gt; $a.Who&lt;br /&gt;&lt;font color=&quot;#ff0000&quot;&gt;&lt;b&gt;Good Guy!&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;/blockquote&gt;Looks perfect, right? But&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The folder where you save your PSSnapin is &lt;b&gt;writeable by any user&lt;/b&gt;, so anyone can change your PSSnapin.&lt;/li&gt;&lt;li&gt;Your PSSnapin assembly is &lt;b&gt;not signed&lt;/b&gt;, so PowerShell will load it without checking its integrity. See the registry key about your PSSnapin&lt;/li&gt;&lt;/ol&gt;&lt;blockquote&gt;Windows Registry Editor Version 5.00&lt;br /&gt;&lt;br /&gt;[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Test]&lt;br /&gt;&quot;PowerShellVersion&quot;=&quot;1.0&quot;&lt;br /&gt;&quot;Vendor&quot;=&quot;http://MSHForFun.blogspot.com/&quot;&lt;br /&gt;&quot;Description&quot;=&quot;Test&quot;&lt;br /&gt;&quot;Version&quot;=&quot;1.0.0.0&quot;&lt;br /&gt;&quot;ApplicationBase&quot;=&quot;D:\\ps1&quot;&lt;br /&gt;&quot;AssemblyName&quot;=&quot;Snapin1, Version=1.0.0.0, Culture=neutral, &lt;font color=&quot;#ff0000&quot;&gt;&lt;b&gt;PublicKeyToken=null&lt;/b&gt;&lt;/font&gt;&quot;&lt;br /&gt;&quot;ModuleName&quot;=&quot;D:\\ps1\\snapin1.dll&quot;&lt;br /&gt;&lt;/blockquote&gt;Suppose there were a malicious user wrote a PSSnapin like yours PSSnapin except Class2: &lt;br /&gt;&lt;blockquote&gt;public class Class2&lt;br /&gt;    {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Who&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return &quot;Bad Guy!&quot;; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;    }&lt;br /&gt;&lt;/blockquote&gt;He just overwrote your PSSnapin with his DLL. What happened next?&lt;br /&gt;&lt;blockquote&gt;&amp;gt; add-pssnapin test&lt;br /&gt; &amp;gt; $a = new-object TestSnapin.Class2&lt;br /&gt; &amp;gt; $a.Who&lt;br /&gt;&lt;font color=&quot;#ff0000&quot;&gt;&lt;b&gt;Bad Guy!&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;/blockquote&gt;That is to say user can run any code he wanted. In a worst condition, when you (&lt;b&gt;An Administrator&lt;/b&gt;) tried to use this PSSnapin, you were actually &lt;b&gt;tricked into running malicious code as Administrator!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;So Lessons: &lt;br /&gt;&lt;ol&gt;&lt;li&gt;Keep an eye on your PSSnapin. Never put them in a directory which is writeable by unprivileged user&lt;/li&gt;&lt;Font color=&quot;red&quot;&gt;Edit: 2006-05-16 08:36&lt;/font&gt;&lt;br /&gt;&quot;Since snapins are programs that you install, it is wise to apply the tenets and best practices of software installation to them...The potential security problems don&#39;t come from PSSnapins -- they come from executing code that you don&#39;t trust. &quot; --Lee&lt;br /&gt;&lt;Font color=&quot;red&quot;&gt;Edit: 2006-05-16 08:36&lt;/font&gt;&lt;br /&gt;&lt;li&gt;Always use a Signed PSSnapin. If a signed PSSnapin were altered, PowerShell will not load it.&lt;/li&gt;&lt;blockquote&gt;&amp;gt; add-pssnapin test&lt;br /&gt;Add-PSSnapin : Cannot load PSSnapIn test. Encountered following error: PSSnapin&lt;br /&gt; module D:\ps1\snapin1.dll doesn&#39;t have required PSSnapin strong name Snapin1,&lt;br /&gt;Version=1.0.0.0, Culture=neutral, PublicKeyToken=3daf9f8a713aaa33.&lt;br /&gt;At line:1 char:13&lt;br /&gt;+ add-pssnapin  &amp;lt;&amp;lt;&amp;lt;&amp;lt; test&lt;br /&gt;&lt;/blockquote&gt;&lt;/ol&gt;&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/114757504586214835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/05/potential-security-problem-of-pssnapin.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114757504586214835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114757504586214835'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/05/potential-security-problem-of-pssnapin.html' title='Potential Security Problem of PSSnapin Installation and Execution'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-114737974215835506</id><published>2006-05-11T16:19:00.000-04:00</published><updated>2006-05-11T16:35:42.323-04:00</updated><title type='text'>New Shell, New Script Language, Same Old Problem</title><content type='html'>I was reading post on &quot;The Old New Thing&quot; titled &quot;&lt;a href=&quot;http://www.leeholmes.com/blog/NothingSolvesEverythingPowerShellAndOtherTechnologies.aspx&quot;&gt;A new scripting language doesn&#39;t solve everything&lt;/a&gt;&quot; yesterday. I was just going to write something about this. Lee was one step ahead of me and did a response post titled &quot;&lt;a href=&quot;http://blogs.msdn.com/oldnewthing/archive/2006/04/27/585047.aspx&quot;&gt;Nothing solves everything - PowerShell and other technologies&lt;/a&gt;&quot;. &lt;br /&gt;&lt;br /&gt;Monad (well, I mean PowerShell) is cool. We have new shell and new script language. But it is still going to be a very long time before we can do everything using cmdlet because not only we need time to write new cmdlets, but also we are limited by what .NET Framwork can do. Most important, monad is NOT supposed to &quot;solve everything&quot;. Instead monad is supposed to work cooperatively with &quot;OLD&quot; techniques. So we have to deal with backwards compatibility issue. For example, other scripting language, unmanaged code and legacy program (console application). I will talk about support for console application in monad hosting application today.&lt;br /&gt;&lt;br /&gt;For a local interactive user, powershell.exe provides nice support for &quot;old&quot; console application inherited from cmd.exe. Common user don&#39;t even feel much difference between cmd.exe and powershell.exe if they just invoke &lt;br /&gt;&lt;blockquote&gt;ping localhost&lt;br /&gt;&lt;/blockquote&gt;For a programmer, there is a difference lying underneath the surface. Monad using &lt;b&gt;PSHostUserinterface&lt;/b&gt; and &lt;b&gt;PSHostRawUserinterface&lt;/b&gt; to get user input and display results if user invokes cmdlets. To support legacy console application, powershell.exe actually &lt;b&gt;create a new process (outside of pipeline) and redirects stdin/stdout/stderr of legacy console application to its own console&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;PowerShell.exe works fine for two reasons:&lt;br /&gt;1. PowerShell.exe itself is a console application. &lt;br /&gt;2. PowerShell.exe does NOT care whether the legacy console application runs in a different process or not. (cmdlet runs in-process)&lt;br /&gt;&lt;br /&gt;It becomes a nightmare if you are going to write a hosting application. Considering what will happen when user invokes console application inside your hosting application like &quot;netsh.exe&quot; which requires user input/output and you did not redirect input and output.&lt;br /&gt;1. Legacy console application start a new process which is out of your control&lt;br /&gt;2. If your hosting application is not a console application (like PowerShell Analyzer), legacy console application start a new Console window which is out of your control. &quot;You can loose output or hang waiting for input that never comes.&quot; -- William Stacey [MVP]&lt;br /&gt;3. For a remoting host application (like my PowerShell Remoting), it is even worse because the new console window is on another computer, there is no way for remote user move their cursor to the console window and provide input.&lt;br /&gt;&lt;br /&gt;It is NOT a trivial work to solve this problem. My &quot;&lt;a href=&quot;http://mshforfun.blogspot.com/2006/03/powershell-remoting-beta-and-future.html&quot;&gt;PowerShell Remoting&lt;/a&gt;&quot; does not solve this issue (A NotSupportException will be thrown if user invoked legacy console application). &lt;a href=&quot;http://karlprosser.edify.us/coder/&quot;&gt;Karl Prosser&#39;s PowerShell Analyzer&lt;/a&gt;&amp;nbsp; does not solve this problem. If you follow the disscussion in newsgroup: &lt;a href=&quot;http://groups.google.com/group/microsoft.public.windows.server.scripting/browse_thread/thread/144cd7a350850e37/1dc331d47ca6c510&quot;&gt;Redirect msh.exe in/out&lt;/a&gt;&amp;nbsp; you will find more people are struggling with this issue. &lt;br /&gt;&lt;br /&gt;So here comes the question: &lt;span style=&quot;font-weight:bold;&quot;&gt;Should this issue been taken care of by internal host or external hosting application?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I think the answer is both YES and NO.&lt;br /&gt;1. &lt;b&gt;NO:&lt;/b&gt; The Design of Monad internal host is to focus on process scripting language, work with objects and piplines. External host is supposed to take care of application logic and user interface.&lt;br /&gt;2. &lt;b&gt;YES:&lt;/b&gt; legacy console application is a PROBLEM for &lt;span style=&quot;font-weight:bold;&quot;&gt;ALL&lt;/span&gt; monad hosting application. So monad should provide more support for it.&lt;br /&gt;&lt;br /&gt;For me, a perfect solution would be that all legacy console application use PSHostUserinterface and PSHostRawUserinterface for &lt;span style=&quot;font-weight:bold;&quot;&gt;ALL&lt;/span&gt; output/input (There are protential big problem behind this). Maybe improvement for PSHostUserinterface and PSHostRawUserinterface&#39;s definition is needed. NotifyBeginApplication() and NotifyEndApplication() is not good enough. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Have Fun&lt;br /&gt;&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/114737974215835506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/05/new-shell-new-script-language-same-old.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114737974215835506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114737974215835506'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/05/new-shell-new-script-language-same-old.html' title='New Shell, New Script Language, Same Old Problem'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-114721032183873270</id><published>2006-05-09T17:29:00.000-04:00</published><updated>2006-05-12T23:02:12.010-04:00</updated><title type='text'>PowerShell Remoting version 0.1.1.7</title><content type='html'>&lt;b&gt;What&#39;s New&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=ce09cdaf-7da2-4f1c-bed3-f8cb35de5aea&quot;&gt;Version 0.1.1.7&lt;/a&gt;&lt;br /&gt;1. Recompiled for new Windows PowerShell RC1 (&lt;b&gt;Refresh version&lt;/b&gt;) &lt;br /&gt;2. Using &quot;&lt;b&gt;Thread Pooling&lt;/b&gt;&quot; method to schedule multiple Host threads. So Sever can potentially &lt;br /&gt;accept more connections. (Old version uses one thread per connection method). &amp;nbsp;&lt;br /&gt;3. Using a separate thread actively &lt;b&gt;reclaim resources&lt;/b&gt; from broken connection and dead host.&lt;br /&gt;4. &lt;b&gt;Clean exit&lt;/b&gt; when stop service: Disconnect all clients and dispose all running hosts.&lt;br /&gt;5. &lt;b&gt;Gracefully disconnect &lt;/b&gt;client when server reach maximum client capacity.&lt;br /&gt;6. Fix: Nested Prompt &lt;b&gt;stack error&lt;/b&gt; when multiple clients connected. &lt;br /&gt;7. Fix: Server unable to exit when &lt;b&gt;connection closed unexpectedly by client&lt;/b&gt;. &lt;br /&gt;8. Fix: &quot;SetShouldExit&quot; method re-throw &quot;&lt;b&gt;SocketException&lt;/b&gt;&quot; Error&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/114721032183873270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/05/powershell-remoting-version-0117.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114721032183873270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114721032183873270'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/05/powershell-remoting-version-0117.html' title='PowerShell Remoting version 0.1.1.7'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-114686331822560082</id><published>2006-05-05T17:06:00.000-04:00</published><updated>2006-05-07T00:49:22.686-04:00</updated><title type='text'>PowerShell Remoting version 0.1.0.317</title><content type='html'>Version 0.1.0.317&lt;br /&gt;1. NestedPrompt (suspend host)&lt;br /&gt;2. Multiple line input mode&lt;br /&gt;3. Use local UI to get login credential&lt;br /&gt;4. Save RawUI state on start, and Reset RawUI state on exit.&lt;br /&gt;5. $CurrentUser Variable (WindowsIdentity Object represent current&lt;br /&gt;   login user)&lt;br /&gt;6. Load user profile in following order&lt;br /&gt;1) &quot;\Documents and settings\All users\PsConfiguration\profile.ps1&quot;&lt;br /&gt;2) &quot;\Documents and settings\All users\PsConfiguration\PowerShellRemoting_profile.ps1&quot;&lt;br /&gt;3) &quot;My Documents\PsConfiguration\profile.ps1&quot;&lt;br /&gt;4) &quot;My Documents\PsConfiguration\PowerShellRemoting_profile.ps1&quot;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://photos1.blogger.com/blogger/5412/2034/1600/client1.2.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;http://photos1.blogger.com/blogger/5412/2034/320/client1.2.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://photos1.blogger.com/blogger/5412/2034/1600/client2.0.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;http://photos1.blogger.com/blogger/5412/2034/320/client2.0.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://photos1.blogger.com/blogger/5412/2034/1600/client3.0.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;http://photos1.blogger.com/blogger/5412/2034/320/client3.0.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://photos1.blogger.com/blogger/5412/2034/1600/client4.0.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;http://photos1.blogger.com/blogger/5412/2034/320/client4.0.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/114686331822560082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/05/powershell-remoting-version-010317.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114686331822560082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114686331822560082'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/05/powershell-remoting-version-010317.html' title='PowerShell Remoting version 0.1.0.317'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-114645978595619960</id><published>2006-05-01T01:00:00.000-04:00</published><updated>2006-10-05T21:16:03.703-04:00</updated><title type='text'>Perfect Prompt for Windows PowerShell</title><content type='html'>&lt;b&gt;What Can Tweaking Your Prompt Do For You?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;Windows PowerShell&lt;/b&gt;&lt;/i&gt; have a default prompt in one color (usually gray) that tells you your current working directory. This is OK, but you can do much more with the prompt. &lt;br /&gt;1. All sorts of information can be displayed (machine name, host name, user name, time &amp;amp; date ...)&lt;br /&gt;2. The prompt can use colors&lt;br /&gt;3. You can also manipulate the windows title to dispaly more information. &lt;br /&gt;4. Other RawUI operation is allowed (move cursor)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Why Bother?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Beyond looking cool, it&#39;s often useful to keep track of system information. &lt;br /&gt;1. Get your current working directory (how many files in current directory)&lt;br /&gt;2. Current system time, how many process is running&lt;br /&gt;2. If you use my &lt;a href=&quot;http://mshforfun.blogspot.com/2006/01/dreaming-of-su-in-msh.html&quot;&gt;su.msh&lt;/a&gt;, you would like to know you current windows identity&lt;br /&gt;3. If you use my &lt;a href=&quot;http://mshforfun.blogspot.com/2006/03/powershell-remoting-beta-and-future.html&quot;&gt;powershell remoting&lt;/a&gt;, different color helps distingish between local host and remote host.&lt;br /&gt;4. Colorizing your prompt is the ability to quickly spot the prompt when you use scroll console. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;First step: Profile and prompt function&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Windows PowerShell use Profile to customize user environment. For more detail, about profile&lt;br /&gt;The Story Behind the Naming and Location of PowerShell Profiles:&lt;br /&gt;&lt;a href=&quot;http://www.leeholmes.com/blog/TheStoryBehindTheNamingAndLocationOfPowerShellProfiles.aspx&quot;&gt;http://www.leeholmes.com/blog/TheStoryBehindTheNamingAndLocationOfPowerShellProfiles.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;1. You can have different prompt for different shell (Maybe you use makeshell.exe generated you own shell)&lt;br /&gt;2. If you have different prompt function defined in multiple profile, the last one excuted take effect&lt;br /&gt;Remember the excution order is&lt;br /&gt;&lt;blockquote&gt;&lt;OL&gt;&lt;LI&gt;&quot;All users&quot; profile is loaded from &quot;&amp;lt;Installation Directory&amp;gt;\profile.ps1&quot; &lt;br /&gt;&lt;LI&gt;&quot;All users,&quot; host-specific profile is loaded from &quot;&amp;lt;Installation Directory&amp;gt;\Microsoft.PowerShell_profile.ps1&quot; &lt;br /&gt;&lt;LI&gt;Current user profile is loaded from &quot;&amp;lt;My Documents&amp;gt;\WindowsPowerShell\profile.ps1&quot; &lt;br /&gt;&lt;LI&gt;Current User, host-specific profile is loaded from &quot;&amp;lt;My Documents&amp;gt;\WindowsPowerShell\Microsoft.PowerShell_profile.ps1&quot;&lt;/LI&gt;&lt;/OL&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;font color=&quot;red&quot;&gt;Edit 09-29-2006&lt;BR&gt;&lt;br /&gt;Windows PowerShell RC2 changed profile location to &lt;br /&gt;&lt;BR&gt;&amp;lt;My documents&amp;gt;\WindowsPowerShell&lt;/font&gt;&lt;br /&gt;Now you can customize you prompt in you profile (say &amp;lt;my document&amp;gt;\psconfigurtion\profile.ps1)&lt;br /&gt;this is typical prompt function looks like:&lt;br /&gt;&lt;blockquote&gt;function prompt&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;PS &quot; + $(get-location) + &quot;&amp;gt; &quot;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;You can do whatever you want in prompt function. But remember &lt;br /&gt;1) Always return a [string], otherwise Windows PowerShell will use default &quot;PS&amp;gt; &quot; prompt. &lt;br /&gt;2) Try to limit your prompt in one (short) line &lt;br /&gt;3) Host will evaluate prompt frequently, so don&#39;t do crazy stuff to slow down your work.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Colorized prompt&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;function prompt&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host (&quot;PS &quot; + $(get-location) +&quot;&amp;gt;&quot;) -nonewline -foregroundcolor Magenta&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot; &quot;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;b&gt;Random color&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;function prompt&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $random = new-object random&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $color=[System.ConsoleColor]$random.next(1,16)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host (&quot;PS &quot; + $(get-location) +&quot;&amp;gt;&quot;) -nonewline -foregroundcolor $color&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot; &quot;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;b&gt;Cursor Movement&lt;/b&gt;&lt;br /&gt;Display current&amp;nbsp; time at the end of prompt line (this will mess up you console buffer)&lt;br /&gt;&lt;blockquote&gt;function prompt&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $oldposition = $host.ui.rawui.CursorPosition&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Endline = $oldposition&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Endline.X+=60&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $host.ui.rawui.CursorPosition = $Endline&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host $(get-date).Tostring(&quot;yyyy-MM-dd HH:mm:ss&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $host.ui.rawui.CursorPosition = $oldposition&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host (&quot;PS &quot; + $(get-location) +&quot;&amp;gt;&quot;) -nonewline -foregroundcolor Magenta &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot; &quot;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;b&gt;Use Window Title&lt;/b&gt;&lt;br /&gt;Show current user, host, current line number&lt;br /&gt;&lt;blockquote&gt;$global:CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent()&lt;br /&gt;function prompt&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $host.ui.rawui.WindowTitle = $CurrentUser.Name + &quot; &quot; + $Host.Name + &quot; &quot; + $Host.Version + &quot; Line: &quot; + $host.UI.RawUI.CursorPosition.Y&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host (&quot;PS &quot; + $(get-location) +&quot;&amp;gt;&quot;) -nonewline -foregroundcolor Magenta &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot; &quot;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;b&gt;Make some noise&lt;/b&gt;&lt;br /&gt;if your command&amp;nbsp; take very long time to run, beep when it is done.&lt;br /&gt;&lt;blockquote&gt;function prompt&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host (&quot;PS &quot; + $(get-location) +&quot;&amp;gt;&quot;) -nonewline -foregroundcolor Magenta &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot;`a &quot;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;b&gt;More information&lt;/b&gt;&lt;br /&gt;Count number of files(or items) in current path and number of process running &lt;br /&gt;&lt;blockquote&gt;function prompt&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $host.ui.rawui.WindowTitle = &quot;Files: &quot; + (get-childitem).count + &quot; Process: &quot; + (get-process).count&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host (&quot;PS &quot; + $(get-location) +&quot;&amp;gt;&quot;) -nonewline -foregroundcolor Magenta &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot; &quot;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;b&gt;Something for readers:&lt;/b&gt;&lt;br /&gt;1. laptop battery is low ! (&lt;Font color=red&gt;Edit 2006-07-21: Already done by &lt;a href=&quot;http://pcmusings.spaces.msn.com/Blog/cns!42B71883C19FDDAE!294.entry&quot;&gt;Musings of a PC&lt;/a&gt;&lt;/font&gt;)&lt;br /&gt;2. You got new mail !&lt;br /&gt;3. LAN cable disconnected !&lt;br /&gt;&lt;br /&gt;Have Fun&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;&lt;a href=&quot;http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/&quot;&gt;http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/&lt;/a&gt;&lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/powershell&quot; rel=&quot;tag&quot;&gt;powershell&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/114645978595619960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/05/perfect-prompt-for-windows-powershell.html#comment-form' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114645978595619960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114645978595619960'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/05/perfect-prompt-for-windows-powershell.html' title='Perfect Prompt for Windows PowerShell'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20327311.post-114606614909177044</id><published>2006-04-26T11:36:00.000-04:00</published><updated>2006-04-28T22:51:39.986-04:00</updated><title type='text'>PowerShell, Change ... is Good ... but Painful</title><content type='html'>&quot;&lt;i&gt;&lt;b&gt;Monad&lt;/b&gt;&lt;/i&gt;&quot; has evolved into &quot;&lt;i&gt;&lt;b&gt;Windows PowerShell&lt;/b&gt;&lt;/i&gt;”. Don’t tell me your feeling about this name. That’s one of the problems working on a pre-release product. Just to make you fell better, it means we are really close to final release.&lt;p&gt;There is a bunch of improvement for console user:&lt;p&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Tab completion gets better now. &lt;p&gt;Did anyone know where is the API mentioned in release note: &lt;i&gt;We added support for parameters and variables tab completion. This was done by having the host call a PowerShell function TabExpansion that takes two parameters – the line being entered and the last token on that line&lt;/i&gt;.&lt;p&gt;2. Some cmdlet Parameters alias changed  &lt;p&gt;For example: *-Process Changed -ProcessName to -Name alias -ProcessName, add alias ProcessId to –Id &lt;p&gt;This makes me feel much better when working with *-process cmdlet.&lt;p&gt;&lt;b&gt;Here comes the pain:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Change your old script file extention: *.msh - &amp;gt; *.ps1&lt;p&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Check into individual script (especially you profile.msh) see if you use any old cmdlet names: for example, combine-path -&amp;gt; join-path&lt;p &gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Change you %my documents%\msh\profile.msh to %my documents%\PSconfiguration\profile.ps1 &lt;p&gt; &lt;p&gt;&lt;b&gt;If you previously wrote some cmdlets or hosting application, you are going to deal with some mess here:&lt;/b&gt;&lt;P&gt;1. Be careful about name changes:&lt;p&gt;CmdletAttribute &lt;br /&gt;VerbNounCommand &lt;br /&gt;&lt;br /&gt;MshHostRawUserInterface &lt;br /&gt;PSHostRawUserInterface &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MshCredential &lt;br /&gt;PSCredential &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MshCredentialTypes &lt;br /&gt;PSCredentialTypes &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MshCredentialUIOptions &lt;br /&gt;PSCredentialUIOptions &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MshInvalidCastException &lt;br /&gt;PSInvalidCastException &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Some hidden changes: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;FieldDescription.AssemblyFullName &lt;br /&gt;FieldDescription.ParameterAssemblyFullName &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;FieldDescription.TypeFullName &lt;br /&gt;FieldDescription.ParameterTypeFullName &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;FieldDescription.TypeName &lt;br /&gt;FieldDescription.ParameterTypeName &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;BufferCell.Type &lt;br /&gt;BufferCell.BufferCellType &lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;If you are using my “Monad Remoting”&lt;/b&gt;&lt;p&gt;&lt;font color=&quot;#ff0000&quot;&gt;&lt;b&gt;Uninstall “Monad Remoting” before upgrade to “PowerShell”&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;You’ve been warned!&lt;/p&gt;    &lt;p&gt;To use “&lt;a href=&quot;http://www.gotdotnet.com/workspaces/workspace.aspx?id=ce09cdaf-7da2-4f1c-bed3-f8cb35de5aea&quot;&gt;PowerShell Remoting&lt;/a&gt;”, you have to change you client script.&lt;br /&gt;To build your own client, be careful about name change. &lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://photos1.blogger.com/blogger/5412/2034/1600/client.3.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;http://photos1.blogger.com/blogger/5412/2034/320/client.3.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;br /&gt;&lt;P&gt; Tags: &lt;a href=&quot;http://technorati.com/tag/msh&quot; rel=&quot;tag&quot;&gt;msh&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://technorati.com/tag/monad&quot; rel=&quot;tag&quot;&gt;monad&lt;/a&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://mshforfun.blogspot.com/feeds/114606614909177044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mshforfun.blogspot.com/2006/04/powershell-change-is-good-but-painful.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114606614909177044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20327311/posts/default/114606614909177044'/><link rel='alternate' type='text/html' href='http://mshforfun.blogspot.com/2006/04/powershell-change-is-good-but-painful.html' title='PowerShell, Change ... is Good ... but Painful'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><thr:total>1</thr:total></entry></feed>