<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Windows PowerShell Blog</title><link>http://blogs.msdn.com/powershell/default.aspx</link><description>Automating the world one-liner at a time.
&lt;table border=0 width=100%&gt;&lt;tr&gt;&lt;td align=right&gt;&lt;a href='http://blogs.msdn.com/powershell/pages/download-windows-powershell.aspx'&gt;&lt;u&gt;Click Here&lt;/u&gt;&lt;/a&gt; to Download PowerShell&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Saving remote session to your local disk</title><link>http://blogs.msdn.com/powershell/archive/2009/12/29/saving-remote-session-to-your-local-disk.aspx</link><pubDate>Tue, 29 Dec 2009 23:09:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9942096</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9942096.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9942096</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9942096</wfw:comment><description>&lt;p&gt;Read the previous &lt;a href="http://blogs.msdn.com/powershell/archive/2009/12/29/bringing-remote-commands-to-your-local-session.aspx"&gt;post on implict remoting&lt;/a&gt; to learn how the &lt;a href="http://go.microsoft.com/fwlink/?LinkID=135221"&gt;Import-PSSession&lt;/a&gt; cmdlet makes it easier to work with remote commands by presenting them as if they were local commands. This user experience saves you the trouble of typing long &lt;a href="http://go.microsoft.com/fwlink/?LinkID=135225"&gt;Invoke-Command&lt;/a&gt; incantations to pass &lt;a href="http://blogs.msdn.com/powershell/archive/2009/12/29/arguments-for-remote-commands.aspx"&gt;arguments to remote commands&lt;/a&gt; or to download remote help content. &lt;/p&gt;  &lt;p&gt;The next great thing would be to jump straight into the implicit remoting experience without having to explicitly set up a remote session each time and having to remember how to invoke Import-PSSession... This is where &lt;a href="http://go.microsoft.com/fwlink/?LinkID=135213"&gt;Export-PSSession&lt;/a&gt; cmdlet comes handy - it can be used to save the remote session and the remote commands to a local disk.&lt;/p&gt;  &lt;h3&gt;Temporary implicit remoting modules&lt;/h3&gt;  &lt;p&gt;Let's &lt;a href="http://blogs.msdn.com/powershell/archive/2009/12/29/bringing-remote-commands-to-your-local-session.aspx"&gt;recall&lt;/a&gt; how one can import remote commands into a local session:&lt;/p&gt;  &lt;pre&gt;PS&amp;gt; $s = New-PSSession -ComputerName lukasza5 -Credential REDMOND\lukasza
PS&amp;gt; Import-PSSession -Session $s -CommandName *-Process -Prefix Remote

ModuleType Name                      ExportedCommands
---------- ----                      ----------------
Script     tmp_a50e3c88-46f1-4c25... {Stop-Process, Get-Process, Debug-Process, Wait-Process...}&lt;/pre&gt;

&lt;p&gt;Import-PSSession cmdlet creates a temporary module containing local functions that act as &lt;a href="http://blogs.msdn.com/powershell/archive/2009/01/04/extending-and-or-modifing-commands-with-proxies.aspx"&gt;proxies&lt;/a&gt; for remote commands. The module is then implicitly imported into the local session by the Import-PSSession cmdlet. The module and all the temporary files are deleted whenever the user explicitly removes the module or when the remote session is closed:&lt;/p&gt;

&lt;pre&gt;PS&amp;gt; Remove-PSSession $s&lt;/pre&gt;

&lt;h3&gt;Saving an implicit remoting module&lt;/h3&gt;

&lt;p&gt;Instead of working with temporary &lt;a href="http://blogs.msdn.com/powershell/archive/2008/08/10/all-about-modules.aspx"&gt;modules&lt;/a&gt; created by Import-PSSession, one can save a module in the file system. This is done one with the Export-PSSession cmdlet. Example below asks Export-PSSession cmdlet to look in the remote session $s, take all the remote commands matching &amp;quot;*-Process&amp;quot; wildcard, and save them to &amp;quot;MyRemoteCommands&amp;quot; module. The example explicitly says that it would be okay to clobber local commands that have the same name as the imported, remote commands.&lt;/p&gt;

&lt;pre&gt;PS&amp;gt; $s = &lt;a href="http://go.microsoft.com/fwlink/?LinkID=135237"&gt;New-PSSession&lt;/a&gt; -ComputerName lukasza5 -Credential REDMOND\lukasza
PS&amp;gt; &lt;a href="http://go.microsoft.com/fwlink/?LinkID=135213"&gt;Export-PSSession&lt;/a&gt; -Session $s -CommandName *-Process -OutputModule MyRemoteCommands -AllowClobber


    Directory: C:\Users\lukasza\Documents\WindowsPowerShell\Modules\MyRemoteCommands


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        2009-12-29  11:50 AM      20535 MyRemoteCommands.psm1
-a---        2009-12-29  11:50 AM         99 MyRemoteCommands.format.ps1xml
-a---        2009-12-29  11:50 AM        598 MyRemoteCommands.psd1


PS C:\&amp;gt; &lt;a href="http://go.microsoft.com/fwlink/?LinkID=135250"&gt;Remove-PSSession&lt;/a&gt; $s&lt;/pre&gt;

&lt;p&gt;You can see that Export-PSSession cmdlet saved a new module under the default user path from ${env:PSModulePath}. No remote commands have been imported into the local session yet - there is no Get-RemoteProcess command and Get-Process works against the local machine.&lt;/p&gt;

&lt;h3&gt;Importing a saved implicit remoting module&lt;/h3&gt;

&lt;p&gt;After implicit remoting module is saved, one can invoke the remote commands without having to ever again use New-PSSession, Invoke-Command, Import-PSSession or Export-PSSession. Let's see how that works: &lt;/p&gt;

&lt;pre&gt;PS&amp;gt; Import-Module MyRemoteCommands -Prefix Remote&lt;/pre&gt;

&lt;p&gt;In the example above, I imported the remote commands from the saved module into the local session (I used the -Prefix parameter to avoid clobbering my local commands). No connection has been made to the remote computer yet, but I can see all the remote commands in &lt;a href="http://go.microsoft.com/fwlink/?LinkID=113309"&gt;Get-Command&lt;/a&gt; and use tab completion when typing them at the command prompt. &lt;/p&gt;

&lt;p&gt;Let's try to invoke one of the commands: &lt;/p&gt;

&lt;pre&gt;PS&amp;gt; Get-RemoteProcess -Name w*host
Creating a new session for implicit remoting of &amp;quot;Get-Process&amp;quot; command...

Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName
-------  ------    -----      ----- -----   ------     -- -----------
    237       9    24372      35556   146     0.95   4344 wsmprovhost&lt;/pre&gt;

&lt;p&gt;The remote invocation worked. I didn't even have to create a remote session - implicit remoting took care of that when I first attempted to use a remote command from the saved module. I've been prompted for the password, but all the other connection parameters (i.e. computer name, http proxy settings) were stored in the saved module. &lt;/p&gt;

&lt;p&gt;Thanks, 
  &lt;br /&gt;

  &lt;br /&gt;Lukasz Anforowicz [MSFT] 

  &lt;br /&gt;Windows PowerShell Developer 

  &lt;br /&gt;Microsoft Corporation&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9942096" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/powershell/archive/tags/Remoting/default.aspx">Remoting</category></item><item><title>Bringing remote commands to your local session</title><link>http://blogs.msdn.com/powershell/archive/2009/12/29/bringing-remote-commands-to-your-local-session.aspx</link><pubDate>Tue, 29 Dec 2009 22:50:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9942092</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9942092.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9942092</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9942092</wfw:comment><description>&lt;p&gt;How can you manage multiple technologies installed on &lt;u&gt;separate machines&lt;/u&gt; that expose their management surface through cmdlets?&amp;#160; One approach would be to open remote desktop connection to each of those machines, another approach would be to send commands using Invoke-Command and PowerShell Remoting.&amp;#160; But remote desktop is not a feasible solution for automation and invoking remote commands using Invoke-Command cmdlet can sometimes get burdensome - tab completion is missing, verbose incantations are needed for passing &lt;a href="http://blogs.msdn.com/powershell/archive/2009/12/29/arguments-for-remote-commands.aspx"&gt;arguments to remote commands&lt;/a&gt; and Get-Help -Online doesn't quite work in a remote session. &lt;/p&gt;  &lt;p&gt;That’s where &lt;strong&gt;IMPLICIT REMOTING&lt;/strong&gt; comes to play – ability to import remote commands into your local session. One can even store the information about imported commands on disk for later use, details in a &lt;a href="http://blogs.msdn.com/powershell/archive/2009/12/29/saving-remote-session-to-your-local-disk.aspx"&gt;later post&lt;/a&gt;. Implicit remoting is a feature that smoothes out the user experience of invoking remote commands.&lt;/p&gt;  &lt;h3&gt;Importing remote commands into local session&lt;/h3&gt;  &lt;p&gt;Let's see how one can import a remote command into a local session. First – let’s ask Import-PSSession cmdlet to look in the remote session $s, take all the remote commands matching &amp;quot;*-Process&amp;quot; wildcard, add a &amp;quot;Remote&amp;quot; prefix to their noun, and then present them to me as if they were local commands: &lt;/p&gt;  &lt;pre&gt;PS&amp;gt; $s = &lt;a href="http://go.microsoft.com/fwlink/?LinkID=135237"&gt;New-PSSession&lt;/a&gt; -ComputerName lukasza5 -Credential REDMOND\lukasza
PS&amp;gt; &lt;a href="http://go.microsoft.com/fwlink/?LinkID=135221"&gt;Import-PSSession&lt;/a&gt; -Session $s -CommandName *-Process -Prefix Remote

ModuleType Name                      ExportedCommands
---------- ----                      ----------------
Script     tmp_a50e3c88-46f1-4c25... {Stop-Process, Get-Process, Debug-Process, Wait-Process...}&lt;/pre&gt;

&lt;h3&gt;Implicit remoting experience&lt;/h3&gt;

&lt;p&gt;The basic promise behind implicit remoting is that you can work with remote commands using local syntax. In particular - after Import-PSSession did its magic I can invoke remote commands as if they were local commands. Let's see if Get-RemoteProcess really works on a different machine than Get-Process: &lt;/p&gt;

&lt;pre&gt;PS&amp;gt; Get-RemoteProcess -Name w*host

Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName
-------  ------    -----      ----- -----   ------     -- -----------
    313      10    39000      51044   162     2.18   2348 wsmprovhost


PS&amp;gt; Get-Process -Name w*host

Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName
-------  ------    -----      ----- -----   ------     -- -----------
    216      11     2056       6132    61     0.09   1208 WUDFHost&lt;/pre&gt;

&lt;p&gt;Below is a list of other things that you can try: &lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Get-RemotePr&amp;lt;tab&amp;gt;: tab completion on remote command and parameter names &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=113316"&gt;Get-Help&lt;/a&gt; Get-RemoteProcess: downloading help content from remote session and displaying it on a local box &lt;/li&gt;

  &lt;li&gt;Get-RemoteProcess -Name $localVariable: binding local variables as &lt;a href="http://blogs.msdn.com/powershell/archive/2009/12/29/arguments-for-remote-commands.aspx"&gt;arguments to parameters of remote commands&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;Get-RemoteProcess -AsJob: invoking remote commands as background jobs using an extra switch parameter added to remote commands &lt;/li&gt;

  &lt;li&gt;Get-RemoteProcess -OutVariable global:localVariable | Out-Null: storing results of remote invocation in a local variable (scope prefix is unfortunately necessary because of implementation details) &lt;/li&gt;

  &lt;li&gt;Get-RemoteProcess | Select-Object -Last 5: mixing remote and local commands in a single pipeline &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks, 
  &lt;br /&gt;

  &lt;br /&gt;Lukasz Anforowicz [MSFT] 

  &lt;br /&gt;Windows PowerShell Developer 

  &lt;br /&gt;Microsoft Corporation&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9942092" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/powershell/archive/tags/Remoting/default.aspx">Remoting</category></item><item><title>How to pass arguments for remote commands</title><link>http://blogs.msdn.com/powershell/archive/2009/12/29/arguments-for-remote-commands.aspx</link><pubDate>Tue, 29 Dec 2009 20:57:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9942055</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9942055.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9942055</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9942055</wfw:comment><description>&lt;p&gt;When invoking remote commands, one often wants to use local values as arguments to the remote command. This post explains how to do that. &lt;/p&gt;  &lt;h3&gt;Hardcoded values&lt;/h3&gt;  &lt;p&gt;Let's start with a simple example. Below you can see how Get-Process is invoked in a remote session when the Id parameter is set to 0:&lt;/p&gt;  &lt;pre&gt;PS&amp;gt; $s = New-PSSession -Computer localhost
PS&amp;gt; Invoke-Command -Session $s -Script { Get-Process &lt;strong&gt;-Id 0&lt;/strong&gt; }
 
Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName     PSComputerName
-------  ------    -----      ----- -----   ------     -- -----------     --------------
      0       0        0         24     0               &lt;strong&gt;0&lt;/strong&gt; Idle            localhost&lt;/pre&gt;

&lt;h3&gt;Passing local values&lt;/h3&gt;

&lt;p&gt;What if we want to calculate the value of the Id parameter programmatically, instead of hard-coding it to a particular integer? Well, script blocks can declare parameters and the param block can be used to pass a value to the command that is being invoked. In the following example, we declare the $processId parameter in the script block and then use the Args parameter of Invoke-Command to set the value of $processId to $pid, which is the process ID of the current Windows PowerShell process.&lt;/p&gt;

&lt;pre&gt;PS&amp;gt; $s = New-PSSession -ComputerName localhost
PS&amp;gt; Invoke-Command -Session $s -Script { &lt;strong&gt;param($processId)&lt;/strong&gt; Get-Process &lt;strong&gt;-Id $processId&lt;/strong&gt; } &lt;strong&gt;-Args $pid&lt;/strong&gt;
 
Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName     PSComputerName
-------  ------    -----      ----- -----   ------     -- -----------     --------------
    533      13    46160      37456   198     6.07   &lt;strong&gt;9488&lt;/strong&gt; &lt;strong&gt;powershell&lt;/strong&gt;      localhost&lt;/pre&gt;

&lt;p&gt;The example above demonstrates that Get-Process was invoked with a process id of the local Windows PowerShell console.&amp;#160; Invoke-Command takes whatever you pass in the Args parameter and binds it to script block's parameters in the remote session. Note that above I simply passed in a value of a local $pid variable, but any local expression (not just a simple variable dereference) can be used instead.&lt;/p&gt;

&lt;h3&gt;Referring to remote variables&lt;/h3&gt;

&lt;p&gt;A different behavior takes place when you don't declare script block parameters using the &amp;quot;param&amp;quot; keyword:&lt;/p&gt;

&lt;pre&gt;PS&amp;gt; $s = New-PSSession -ComputerName localhost
PS&amp;gt; Invoke-Command -Session $s -Script { Get-Process &lt;strong&gt;-Id $pid&lt;/strong&gt; }
 
Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     &lt;strong&gt;Id&lt;/strong&gt; ProcessName     PSComputerName
-------  ------    -----      ----- -----   ------     -- -----------     --------------
    329      10    21216      33524   154     7.63   &lt;strong&gt;6596 wsmprovhost&lt;/strong&gt;     localhost&lt;/pre&gt;

&lt;p&gt;In this case $pid is an unbound variable and Windows PowerShell assumes that it refers to the $pid variable in the remote session. Therefore, as you can see Get-Process returns the process that hosts the remote session. &lt;/p&gt;

&lt;h3&gt;Magic $args variable&lt;/h3&gt;
What happens when you use the Args parameter of Invoke-Command cmdlet, but don't declare any parameters in the script block? Local values are still passed to the remote session and in this case are bound to the &lt;a href="http://blogs.msdn.com/powershell/attachment/1525634.ashx"&gt;$args variable&lt;/a&gt;. This can save some typing: 

&lt;pre&gt;PS&amp;gt; $s = New-PSSession -ComputerName localhost
PS&amp;gt; Invoke-Command -Session $s -Script { Get-Process &lt;strong&gt;-Id $args[0]&lt;/strong&gt; } &lt;strong&gt;-Args $pid&lt;/strong&gt;

Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName                    PSComputerName
-------  ------    -----      ----- -----   ------     -- -----------                    --------------
    808      46    76840      81876   596     5.05   7824 powershell                     localhost&lt;/pre&gt;

&lt;p&gt;Thanks, 
  &lt;br /&gt;

  &lt;br /&gt;Lukasz Anforowicz [MSFT] 

  &lt;br /&gt;Windows PowerShell Developer 

  &lt;br /&gt;Microsoft Corporation&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9942055" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/powershell/archive/tags/Remoting/default.aspx">Remoting</category></item><item><title>PowerShell Help Reader – WOW!</title><link>http://blogs.msdn.com/powershell/archive/2009/12/26/powershell-help-reader-wow.aspx</link><pubDate>Sat, 26 Dec 2009 19:03:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9941291</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9941291.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9941291</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9941291</wfw:comment><description>&lt;p&gt;Alexey Martseniuk posted a blog entry in the &lt;a href="http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.windows.powershell&amp;amp;mid=133e6be4-aeaa-490d-b1ad-032c0d947793"&gt;PowerShell NewsGroup&lt;/a&gt; announcing a new version (V1.2) of the PowerShell Help Reader.&amp;#160; My first reaction is WOW!&lt;/p&gt;  &lt;p&gt;Start your wow experience by going to &lt;a href="http://PowershellTools.Com"&gt;http://PowershellTools.Com&lt;/a&gt; and checking out the Silverlight-based intro screen.&amp;#160; (You’ll need Silverlight of course but you should have it anyway – it is awesome.)&amp;#160; This is the harbinger of things to come.&amp;#160; The installed app takes advantage of WPF to deliver an excellent help experience.&amp;#160; &lt;/p&gt;  &lt;p&gt;The basic edition of the product is free and contains all the features but works only for the built-in PowerShell snap-ins/modules.&amp;#160; The professional Edition has no limitations.&lt;/p&gt;  &lt;p&gt;This is a great looking tool and addresses a lot of the shortcomings of our help.&lt;/p&gt;  &lt;p&gt;Great job Alexey!&lt;/p&gt;  &lt;p&gt;Experiment!&amp;#160; Enjoy!&amp;#160; Engage! &lt;/p&gt;  &lt;p&gt;Jeffrey Snover [MSFT]   &lt;br /&gt;Distinguished Engineer    &lt;br /&gt;Visit the Windows PowerShell Team blog at:&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://blogs.msdn.com/PowerShell"&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt;    &lt;br /&gt;Visit the Windows PowerShell ScriptCenter at:&amp;#160; &lt;a href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9941291" width="1" height="1"&gt;</description></item><item><title>A Christmas Tree in WPK</title><link>http://blogs.msdn.com/powershell/archive/2009/12/26/a-christmas-tree-in-wpk.aspx</link><pubDate>Sat, 26 Dec 2009 01:16:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9941200</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9941200.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9941200</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9941200</wfw:comment><description>&lt;p&gt;Merry Christmas.&amp;#160; To celebrate the holiday, here’s a quick Christmas tree written in WPK (the WPF PowerShell Kit).&amp;#160; You can get WPK as part of the PowerShellPack (&lt;a href="http://code.msdn.microsoft.com/PowerShellPack"&gt;http://code.msdn.microsoft.com/PowerShellPack&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;Here’s a screenshot:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/powershell/WindowsLiveWriter/AChristmasTreeinWPK_F2FB/XmasTree.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="XmasTree" border="0" alt="XmasTree" src="http://blogs.msdn.com/blogfiles/powershell/WindowsLiveWriter/AChristmasTreeinWPK_F2FB/XmasTree_thumb.png" width="195" height="217" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;and Here’s the script:&lt;/p&gt;  &lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #0000ff"&gt;Import-Module&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;WPK&lt;/span&gt;            
            
&lt;span style="color: #0000ff"&gt;New-Polygon&lt;/span&gt; &lt;span style="color: #000080"&gt;-Points&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;            
    &lt;span style="color: #006400"&gt;# Start from the top&lt;/span&gt;            
    &lt;span style="color: #8b0000"&gt;&amp;quot;87.5,0&amp;quot;&lt;/span&gt;            
    &lt;span style="color: #006400"&gt;# Left Side of Tree&lt;/span&gt;            
    &lt;span style="color: #8b0000"&gt;&amp;quot;0,150&amp;quot;&lt;/span&gt;             
    &lt;span style="color: #8b0000"&gt;&amp;quot;75,140&amp;quot;&lt;/span&gt;            
    &lt;span style="color: #006400"&gt;# Bottom of Tree&lt;/span&gt;            
    &lt;span style="color: #8b0000"&gt;&amp;quot;75,175&amp;quot;&lt;/span&gt;            
    &lt;span style="color: #8b0000"&gt;&amp;quot;95,175&amp;quot;&lt;/span&gt;            
    &lt;span style="color: #006400"&gt;# Right Side of Tree&lt;/span&gt;            
    &lt;span style="color: #8b0000"&gt;&amp;quot;95,140&amp;quot;&lt;/span&gt;            
    &lt;span style="color: #8b0000"&gt;&amp;quot;175,150&amp;quot;&lt;/span&gt;            
    &lt;span style="color: #006400"&gt;# Back to the top&lt;/span&gt;            
    &lt;span style="color: #8b0000"&gt;&amp;quot;87.5,0&amp;quot;&lt;/span&gt;            
&lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #000080"&gt;-On_SizeChanged&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;            
    &lt;span style="color: #00008b"&gt;if&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;PreviousSize&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Width&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt; &lt;span style="color: #800080"&gt;0&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-and&lt;/span&gt;            
        &lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;PreviousSize&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Height&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt; &lt;span style="color: #800080"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;            
        &lt;span style="color: #ff4500"&gt;$this&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Resources&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;OriginalSize&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;NewSize&lt;/span&gt;            
    &lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #00008b"&gt;else&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;            
            
        &lt;span style="color: #ff4500"&gt;$originalSize&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$this&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Resources&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;OriginalSize&lt;/span&gt;            
        &lt;span style="color: #ff4500"&gt;$ScaleX&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;NewSize&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Width&lt;/span&gt;  &lt;span style="color: #a9a9a9"&gt;/&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$originalSize&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Width&lt;/span&gt;             
        &lt;span style="color: #ff4500"&gt;$ScaleY&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;NewSize&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Height&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;/&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$originalSize&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Height&lt;/span&gt;             
        &lt;span style="color: #ff4500"&gt;$this&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;RenderTransform&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New-ScaleTransform&lt;/span&gt; &lt;span style="color: #000080"&gt;-ScaleX&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$ScaleX&lt;/span&gt; &lt;span style="color: #000080"&gt;-ScaleY&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$ScaleY&lt;/span&gt;            
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;                    
&lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #000080"&gt;-BitmapEffect&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;             
    &lt;span style="color: #0000ff"&gt;New-BevelBitmapEffect&lt;/span&gt; &lt;span style="color: #000080"&gt;-BevelWidth&lt;/span&gt; &lt;span style="color: #800080"&gt;1&lt;/span&gt;            
&lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #000080"&gt;-Fill&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;DarkGreen&lt;/span&gt; &lt;span style="color: #000080"&gt;-AsJob&lt;/span&gt;                                    &lt;/pre&gt;

&lt;p&gt;It’s only about 30 lines, but this script has tons of Christmas goodies.&amp;#160; It shows an example of how to create any random polygon with a simple list of points, how to resize that polygon to whatever size the control need to be, and how to apply a quick bitmap effect to an image.&lt;/p&gt;

&lt;p&gt;Hope this Helps,&lt;/p&gt;

&lt;p&gt;James&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9941200" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/powershell/archive/tags/PowerShell+V2/default.aspx">PowerShell V2</category><category domain="http://blogs.msdn.com/powershell/archive/tags/PowerShellPack/default.aspx">PowerShellPack</category><category domain="http://blogs.msdn.com/powershell/archive/tags/WPK/default.aspx">WPK</category></item><item><title>PowerShellPack Reaches 10,000 Downloads in 3 Months</title><link>http://blogs.msdn.com/powershell/archive/2009/12/24/powershellpack-reaches-10-000-downloads-in-3-months.aspx</link><pubDate>Thu, 24 Dec 2009 00:39:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9940791</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9940791.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9940791</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9940791</wfw:comment><description>&lt;p&gt;Just before the release of Windows 7, the Windows 7 Resource Kit PowerShell Pack was released.&amp;#160; Today, it hit 10,000 downloads.&lt;/p&gt;  &lt;p&gt;It contains 10 useful modules that help you do more with Windows PowerShell.&amp;#160; It has modules that can help every IT admin ( like the TaskScheduler module), and modules that can help any .NET developer (like PSCodeGen).&amp;#160; There’s also a nifty module, IsePack, which provides a set of tools for working with the Windows PowerShell Integrated Scripting Environment. It also contains WPK, a module that allows you to script rich WPF UIs with PowerShell.&lt;/p&gt;  &lt;p&gt;If you haven’t taken the time to check it out yet, you should.&amp;#160; It can help any scripter get up to speed with the possibilities of PowerShell V2.&amp;#160; You can check out the PowerShellPack on MSDN Code Gallery:&amp;#160; &lt;a href="http://code.msdn.microsoft.com/PowerShellPack"&gt;http://code.msdn.microsoft.com/PowerShellPack&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you’re interested in scripting UI in PowerShell, these three Channel9 videos should help get you started:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/LarryLarsen/Quick-UI-with-WPK-in-Windows-PowerShell"&gt;Writing User Interfaces with WPK&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/philpenn/Windows-PowerShell--A-Brief-Introduction-to-using-WPF-Containers-in-WPK/"&gt;A Brief Introduction to using WPF containers in WPK&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/LarryLarsen/Multitouch-Fingerpaint-in-30-Lines-of-PowerShell-Script/"&gt;Multitouch Fingerpaint in 30 lines of PowerShell Script&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If you want to try using the Task Scheduler module, you can check out this blog post:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/powershell/archive/2009/10/30/sending-automated-emails-with-send-mailmessage-convertto-html-and-the-powershellpack-s-taskscheduler-module.aspx"&gt;Sending Automated emails with Send-MailMessage, ConvertTo-HTML, and the Task Scheduler Module&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Go ahead and check out the PowerShellPack.&amp;#160; It’s a great way to see all that PowerShell V2 is capable of.&lt;/p&gt;  &lt;p&gt;Hope this helps,&lt;/p&gt;  &lt;p&gt;James Brundage [MSFT]&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9940791" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/powershell/archive/tags/Module/default.aspx">Module</category><category domain="http://blogs.msdn.com/powershell/archive/tags/PowerShell+V2/default.aspx">PowerShell V2</category><category domain="http://blogs.msdn.com/powershell/archive/tags/PowerShellPack/default.aspx">PowerShellPack</category><category domain="http://blogs.msdn.com/powershell/archive/tags/WPK/default.aspx">WPK</category></item><item><title>Windows PowerShell 2.0 SDK</title><link>http://blogs.msdn.com/powershell/archive/2009/12/23/windows-powershell-2-0-sdk.aspx</link><pubDate>Wed, 23 Dec 2009 11:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9940479</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9940479.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9940479</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9940479</wfw:comment><description>&lt;P&gt;&lt;A href="http://blogs.msdn.com/photos/glengordon/picture652649.aspx" target=_blank&gt;&lt;/A&gt;Windows PowerShell 2.0 Software Development Kit (SDK) is now &lt;A title="Windows PowerShell 2.0  SDK" href="http://go.microsoft.com/fwlink/?LinkID=180421" target=_blank mce_href="http://go.microsoft.com/fwlink/?LinkID=180421 "&gt;available for download&lt;/A&gt;. This SDK contains sample code and reference assemblies that allow you to build applications based on Windows PowerShell. &lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The samples demonstrate how to use the Windows PowerShell 2.0 APIs. You will also find sample code&amp;nbsp;that shows how to use the new PowerShell class, how to write cmdlets that supports eventing, transactions and jobs. In addition, there are examples of host applications that connect to remote computers using individual runspaces and runspace pools. &lt;/SPAN&gt;&lt;SPAN&gt;This SDK release also include modified Windows PowerShell 1.0 samples using the improved Windows PowerShell 2.0 APIs.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Hemant Mahawar [MSFT]&lt;BR&gt;Program Manager&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9940479" width="1" height="1"&gt;</description></item><item><title>New-Object PSObject –Property [HashTable]</title><link>http://blogs.msdn.com/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx</link><pubDate>Sat, 05 Dec 2009 04:30:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9932888</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>15</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9932888.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9932888</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9932888</wfw:comment><description>&lt;pre class="PowerShellColorizedScript"&gt;Let me start of by suggesting you take a few minutes and read Laerte Junior’s excellent blog &lt;br /&gt;entry &lt;a href="http://www.simple-talk.com/content/article.aspx?article=874"&gt;Exceptional PowerShell DBA Pt1 Orphaned Users&lt;/a&gt;.  Laerte does a great job describing the &lt;br /&gt;scenario, the approach he took to solving it and then he included the scripts!  Really good&lt;br /&gt;stuff Laerte! &lt;/pre&gt;

&lt;pre class="PowerShellColorizedScript"&gt;When I looked at Laerte’s code, I recognized one of my least favorite PowerShell V1isms:&lt;/pre&gt;

&lt;pre class="PowerShellColorizedScript"&gt;		&lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;PSObject&lt;/span&gt;                                       
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;LineNumber&lt;/span&gt;       &lt;span style="color: #ff4500"&gt;$LineNumber&lt;/span&gt;                 
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Date&lt;/span&gt;             &lt;span style="color: #ff4500"&gt;$TodayDate&lt;/span&gt;              
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;ServerName&lt;/span&gt;       &lt;span style="color: #ff4500"&gt;$svr&lt;/span&gt;            
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;DatabaseName&lt;/span&gt;     &lt;span style="color: #ff4500"&gt;$Database&lt;/span&gt;            
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;UserName&lt;/span&gt;         &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;            
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;CreateDate&lt;/span&gt;       &lt;span style="color: #ff4500"&gt;$CreateDate&lt;/span&gt;            
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;DateLastModified&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$DateLastModified&lt;/span&gt;            
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;AsymMetricKey&lt;/span&gt;    &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;AsymMetricKey&lt;/span&gt;            
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;DefaultSchema&lt;/span&gt;    &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DefaultSchema&lt;/span&gt;            
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;HasDBAccess&lt;/span&gt;      &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;HasDBAccess&lt;/span&gt;            
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;ID&lt;/span&gt;               &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;ID&lt;/span&gt;            
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;LoginType&lt;/span&gt;        &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;LoginType&lt;/span&gt;            
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Login&lt;/span&gt;            &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Login&lt;/span&gt;            
               &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;add-member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Noteproperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Orphan&lt;/span&gt;           &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Login&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt; &lt;span style="color: #8b0000"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;            
                                &lt;/pre&gt;

&lt;p&gt;Gosh that is a horrible looking thing.&amp;#160; This is one of the things we fixed with PowerShell V2 so you take a few minutes to 
  &lt;br /&gt;learn this so you never have to do that mess again.&amp;#160; Let’s get some help: 

  &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2" face="Courier New"&gt;PS&amp;gt; G&lt;strong&gt;et-Help New-Object -Parameter Property&lt;/strong&gt; &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2" face="Courier New"&gt;-Property &amp;lt;hashtable&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Sets property values and invokes methods of the new object. 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Enter a hash table in which the keys are the names of properties or methods and the values are property value 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; s or method arguments. New-Object creates the object and sets each property value and invokes each method in 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; the order that they appear in the hash table. 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; If the new object is derived from the PSObject class, and you specify a property that does not exist on the o 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; bject, New-Object adds the specified property to the object as a NoteProperty. If the object is not a PSObjec 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; t, the command generates a non-terminating error. 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Required?&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; false 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Position?&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; named 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Default value&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Accept pipeline input?&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; false 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Accept wildcard characters?&amp;#160; false&lt;/font&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160; &lt;/p&gt;

&lt;p&gt;Thats right – you can now specify a hashtable and we’ll set these as NoteProperties on an object.&amp;#160; What that means is that you can now write code like this: &lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #ff4500"&gt;    $Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;PSObject&lt;/span&gt; &lt;span style="color: #000080"&gt;-Property&lt;/span&gt; &lt;span style="color: #000000"&gt;@{&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;LineNumber&lt;/span&gt;       &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$LineNumber&lt;/span&gt;                 
        &lt;span style="color: #000000"&gt;Date&lt;/span&gt;             &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$TodayDate&lt;/span&gt;              
        &lt;span style="color: #000000"&gt;ServerName&lt;/span&gt;       &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$svr&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;DatabaseName&lt;/span&gt;     &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$Database&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;UserName&lt;/span&gt;         &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;CreateDate&lt;/span&gt;       &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$CreateDate&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;DateLastModified&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$DateLastModified&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;AsymMetricKey&lt;/span&gt;    &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;AsymMetricKey&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;DefaultSchema&lt;/span&gt;    &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DefaultSchema&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;HasDBAccess&lt;/span&gt;      &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;HasDBAccess&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;ID&lt;/span&gt;               &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;ID&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;LoginType&lt;/span&gt;        &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;LoginType&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;Login&lt;/span&gt;            &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Login&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;Orphan&lt;/span&gt;           &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Login&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt; &lt;span style="color: #8b0000"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;            
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;                           
                                    &lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;or if you prefer:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #ff4500"&gt;   $hash&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #000000"&gt;@{&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;LineNumber&lt;/span&gt;       &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$LineNumber&lt;/span&gt;                 
        &lt;span style="color: #000000"&gt;Date&lt;/span&gt;             &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$TodayDate&lt;/span&gt;              
        &lt;span style="color: #000000"&gt;ServerName&lt;/span&gt;       &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$svr&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;DatabaseName&lt;/span&gt;     &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$Database&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;UserName&lt;/span&gt;         &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;name&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;CreateDate&lt;/span&gt;       &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$CreateDate&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;DateLastModified&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$DateLastModified&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;AsymMetricKey&lt;/span&gt;    &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;AsymMetricKey&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;DefaultSchema&lt;/span&gt;    &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DefaultSchema&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;HasDBAccess&lt;/span&gt;      &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;HasDBAccess&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;ID&lt;/span&gt;               &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;ID&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;LoginType&lt;/span&gt;        &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;LoginType&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;Login&lt;/span&gt;            &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Login&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;Orphan&lt;/span&gt;           &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$user&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Login&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt; &lt;span style="color: #8b0000"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;            
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;                           
                                    
    &lt;span style="color: #ff4500"&gt;$Object&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;PSObject&lt;/span&gt; &lt;span style="color: #000080"&gt;-Property&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$hash&lt;/span&gt;            &lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;This is SO much better than V1 – be sure to use it and to tell all your friends about it as well!&amp;#160; &lt;/p&gt;

&lt;p&gt;Experiment!&amp;#160; Enjoy!&amp;#160; Engage! &lt;/p&gt;

&lt;p&gt;Jeffrey Snover [MSFT] 
  &lt;br /&gt;Distinguished Engineer 

  &lt;br /&gt;Visit the Windows PowerShell Team blog at:&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://blogs.msdn.com/PowerShell"&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt; 

  &lt;br /&gt;Visit the Windows PowerShell ScriptCenter at:&amp;#160; &lt;a href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9932888" width="1" height="1"&gt;</description></item><item><title>You Don’t Have to Be An Administrator to Run Remote PowerShell Commands</title><link>http://blogs.msdn.com/powershell/archive/2009/11/23/you-don-t-have-to-be-an-administrator-to-run-remote-powershell-commands.aspx</link><pubDate>Mon, 23 Nov 2009 00:52:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9927053</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9927053.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9927053</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9927053</wfw:comment><description>&lt;p&gt;I was just read blog entry which complained about having to have administrative access to execute PowerShell commands against a remote server.&amp;#160; This is not the case.&lt;/p&gt;  &lt;p&gt;We are “&lt;em&gt;secure by default&lt;/em&gt;” which means that if you want to do something that exposes a security risk to your machines, you have to make a conscious decision to do so.&amp;#160; We are secure by default so that you can feel confident in putting PowerShell on all your machines.&amp;#160; Your risks are a function of the decisions you make after&amp;#160; you install PowerShell and we’ll educate you about the risks and benefits of those decisions.&amp;#160; (Run “Get-Help about_Execution_Policies” to see a great example of that.)&lt;/p&gt;  &lt;p&gt;That is why remoting is turned off by default and you have to run Enable-PSRemoting to turn it on.&amp;#160; &lt;/p&gt;  &lt;p&gt;When you do this, we create the default PSSessionConfiguration called Microsoft.PowerShell with a SDDL which only allows people with administrative rights to execute remote commands on that machine.&amp;#160; You can see that by the following command:&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Courier New"&gt;PS&amp;gt; Get-PSSessionConfiguration |fl * &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Courier New"&gt;Name&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : microsoft.powershell     &lt;br /&gt;Filename&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : %windir%\system32\pwrshplugin.dll      &lt;br /&gt;SDKVersion&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 1      &lt;br /&gt;XmlRenderingType&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : text      &lt;br /&gt;lang&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : en-US      &lt;br /&gt;PSVersion&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : 2.0      &lt;br /&gt;ResourceUri&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : &lt;/font&gt;&lt;a href="http://schemas.microsoft.com/powershell/microsoft.powershell"&gt;&lt;font color="#000080" size="2" face="Courier New"&gt;http://schemas.microsoft.com/powershell/microsoft.powershell&lt;/font&gt;&lt;/a&gt;    &lt;br /&gt;&lt;font color="#000080" size="2" face="Courier New"&gt;SupportsOptions&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : true     &lt;br /&gt;Capability&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : {Shell}      &lt;br /&gt;xmlns&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : &lt;/font&gt;&lt;a href="http://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration"&gt;&lt;font color="#000080" size="2" face="Courier New"&gt;http://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration&lt;/font&gt;&lt;/a&gt;    &lt;br /&gt;&lt;font color="#000080" size="2" face="Courier New"&gt;Uri&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : &lt;/font&gt;&lt;a href="http://schemas.microsoft.com/powershell/Microsoft.PowerShell"&gt;&lt;font color="#000080" size="2" face="Courier New"&gt;http://schemas.microsoft.com/powershell/Microsoft.PowerShell&lt;/font&gt;&lt;/a&gt;    &lt;br /&gt;&lt;font color="#000080" size="2" face="Courier New"&gt;ExactMatch&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : false     &lt;br /&gt;&lt;font color="#ff0000"&gt;SecurityDescriptorSddl : O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)       &lt;br /&gt;Permission&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : BUILTIN\Administrators AccessAllowed&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If you decide you want to allow others, what you do is run the command:   &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Courier New"&gt;PS&amp;gt; &lt;strong&gt; Set-PSSessionConfiguration -Name Microsoft.PowerShell -showSecurityDescriptorUI &lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Courier New"&gt;Confirm     &lt;br /&gt;Are you sure you want to perform this action?      &lt;br /&gt;Performing operation &amp;quot;Set-PSSessionConfiguration&amp;quot; on Target &amp;quot;Name: Microsoft.PowerShell&amp;quot;.      &lt;br /&gt;[Y] Yes&amp;#160; [A] Yes to All&amp;#160; [N] No&amp;#160; [L] No to All&amp;#160; [S] Suspend&amp;#160; [?] Help (default is &amp;quot;Y&amp;quot;): y&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Courier New"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Notice that this action could have a serious impact on your system so we ask you to confirm that you really want to do this.(In general we assume you know what you are doing and only bring up these nag-messages when we think it is super important that you not sleep walk through this one.&amp;#160; You can always add a –FORCE switch to bypass this message.)&amp;#160; This brings up the following dialog box which allows you to give others the ability to run commands on that machine:   &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/powershell/WindowsLiveWriter/YouDontHavetoBeAnAdministratortoRunRemot_ED2C/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/powershell/WindowsLiveWriter/YouDontHavetoBeAnAdministratortoRunRemot_ED2C/image_thumb.png" width="399" height="483" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Experiment!&amp;#160; Enjoy!&amp;#160; Engage! &lt;/p&gt;  &lt;p&gt;Jeffrey Snover [MSFT]   &lt;br /&gt;Distinguished Engineer    &lt;br /&gt;Visit the Windows PowerShell Team blog at:&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://blogs.msdn.com/PowerShell"&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt;    &lt;br /&gt;Visit the Windows PowerShell ScriptCenter at:&amp;#160; &lt;a href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9927053" width="1" height="1"&gt;</description></item><item><title>Windows PowerShell and the Windows Management Framework</title><link>http://blogs.msdn.com/powershell/archive/2009/11/20/windows-powershell-and-the-windows-management-framework.aspx</link><pubDate>Fri, 20 Nov 2009 00:43:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9925909</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9925909.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9925909</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9925909</wfw:comment><description>&lt;p&gt;There’s been a lot of great excitement that’s accompanied the release of PowerShell V2 and Windows Remote Management (WinRM) – also known as the Windows Management Framework. We’ve also heard the occasional question on whether it’s possible to install them independently.&lt;/p&gt;  &lt;p&gt;When we’ve heard this concern, it is usually focused on security. To be clear, Windows Remote Management (WinRM) has been part of Windows since Vista and Server 2008. It does not listen to network connections by default, and must be explicitly activated. Both have advanced greatly during the release of Windows 7 – most notably by working together to support a rich PowerShell-based remoting experience.&lt;/p&gt;  &lt;p&gt;The Windows Management Framework download (PowerShell + WinRM) simply updates the binaries on non-Win7 machines to bring them up to the same version already included in Windows 7 and Windows Server 2008 R2.&lt;/p&gt;  &lt;p&gt;Investigating this concern further, it usually comes down to concern about increased network attack surface: automatically opening a network port to accept incoming connections. Installing the Windows Management Framework does not do this automatically. “Secure by Default” is the mantra of both our team, and Microsoft as a whole. Enabling PowerShell Remoting is an explicit step that must be run from an elevated prompt. The command fully informs you of the security implications when you do so:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;[C:\Windows\system32]       &lt;br /&gt;PS:101 &amp;gt; Enable-PsRemoting&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;WinRM Quick Configuration&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;Running command &amp;quot;Set-WSManQuickConfig&amp;quot; to enable this machine for remote management through WinRM service.&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;This includes:       &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; 1. Starting or restarting (if already started) the WinRM service       &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; 2. Setting the WinRM service type to auto start       &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; 3. Creating a listener to accept requests on any IP address       &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; 4. Enabling firewall exception for WS-Management traffic (for http only).&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;Do you want to continue?       &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;[Y] Yes&amp;#160; [A] Yes to All&amp;#160; [N] No&amp;#160; [L] No to All&amp;#160; [S] Suspend&amp;#160; [?] Help (default is &amp;quot;Y&amp;quot;):&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;While we (and Windows Security, and external security consultants that we hired for analysis and penetration testing) &lt;b&gt;also&lt;/b&gt; believe in the security of our remoting protocol and the attack surface that it exposes, we focused from the start on letting you make that decision independently.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Lee Holmes [MSFT]   &lt;br /&gt;Windows PowerShell Development    &lt;br /&gt;Microsoft Corporation&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9925909" width="1" height="1"&gt;</description></item><item><title>PDC09 SVR12 and SVR13 Session Demos</title><link>http://blogs.msdn.com/powershell/archive/2009/11/19/pdc09-svr12-and-svr13-demos-session-demos.aspx</link><pubDate>Thu, 19 Nov 2009 02:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9925010</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9925010.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9925010</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9925010</wfw:comment><description>&lt;P&gt;Attached are the demos from the PDC sessions SVR12 and SVR 13 today. Here are the steps you need to do before you can run them&lt;/P&gt;
&lt;P&gt;1. Unzip the files and run setup\setup.ps1. This will configure user accounts and initialize some files required&lt;/P&gt;
&lt;P&gt;2. Change computers.dat in service\roles\. Set it to the computers that you want to connect to&lt;/P&gt;
&lt;P&gt;3. Edit Impersonation\Get-DelegationCredential.ps1 under each folder - Inventory, Service and Employee (Please Note: This script is intended only for demo purposes and is not recommended to be copied for production&lt;/P&gt;
&lt;P&gt;4. Set the paths in app.xaml.cs in each of the visual studio projects - EasyGUI and RemoteUI&lt;/P&gt;
&lt;P&gt;Once the above are done then you are all set. Play around with them and have fun !!!&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;
&lt;P&gt;Nana&lt;/P&gt;
&lt;P&gt;---&lt;/P&gt;
&lt;P&gt;Narayanan Lakshmanan [MSFT] &lt;BR&gt;Developer&lt;BR&gt;Visit the Windows PowerShell Team blog at:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://blogs.msdn.com/PowerShell" mce_href="http://blogs.msdn.com/PowerShell"&gt;&lt;STRONG&gt;&lt;FONT color=#006bad&gt;http://blogs.msdn.com/PowerShell&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/A&gt; &lt;BR&gt;Visit the Windows PowerShell ScriptCenter at:&amp;nbsp; &lt;A href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx" mce_href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;&lt;STRONG&gt;&lt;FONT color=#006bad&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9925010" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/powershell/attachment/9925010.ashx" length="183621" type="application/x-zip-compressed" /></item><item><title>I Can Do That With 1 Line of PowerShell: Installed Software</title><link>http://blogs.msdn.com/powershell/archive/2009/11/15/i-can-do-that-with-1-line-of-powershell-installed-software.aspx</link><pubDate>Sun, 15 Nov 2009 17:42:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9922651</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9922651.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9922651</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9922651</wfw:comment><description>&lt;p&gt;Ying Li has a cool PowerShell Script to list installed Software on a local computer &lt;a href="http://myitforum.com/cs2/blogs/yli628/archive/2008/01/16/powershell-script-to-list-installed-software-on-local-computer.aspx"&gt;HERE&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;When I looked at it and thought to myself, I can do that with 1 line (if I cheat a little).&amp;#160; Here it is:&lt;/p&gt;  &lt;p&gt;&lt;font color="#000080" size="2" face="Courier New"&gt;PS&amp;gt; gp HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |Select DisplayName, DisplayVersion, Publisher, InstallDate, HelpLink, UninstallString |ogv&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here is what&amp;#160; you get for that 1 line of code:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/powershell/WindowsLiveWriter/ICanDoThatWith1LineofPowerShellInstalled_8872/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/powershell/WindowsLiveWriter/ICanDoThatWith1LineofPowerShellInstalled_8872/image_thumb.png" width="875" height="410" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I cheated by using OGV&amp;#160; (Out-GridView).&amp;#160; Ying used Excel and the output is nicer.&amp;#160; But when you only want to spend a single line…&amp;#160; :-)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Experiment!&amp;#160; Enjoy!&amp;#160; Engage! &lt;/p&gt;  &lt;p&gt;Jeffrey Snover [MSFT]   &lt;br /&gt;Distinguished Engineer    &lt;br /&gt;Visit the Windows PowerShell Team blog at:&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://blogs.msdn.com/PowerShell"&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt;    &lt;br /&gt;Visit the Windows PowerShell ScriptCenter at:&amp;#160; &lt;a href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9922651" width="1" height="1"&gt;</description></item><item><title>SRV312 TechEd Slides</title><link>http://blogs.msdn.com/powershell/archive/2009/11/12/srv312-teched-slides.aspx</link><pubDate>Thu, 12 Nov 2009 13:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9921338</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9921338.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9921338</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9921338</wfw:comment><description>&lt;P&gt;I just gave the talk, "”Server Management Improvements and Solutions for Windows Server 2008 R2”.&amp;nbsp; It went over rather well.&amp;nbsp; Attached are the slides.&amp;nbsp; I will try to get you the demos but that will be difficult and will take some time.&lt;/P&gt;
&lt;P&gt;Enjoy! &lt;/P&gt;
&lt;P&gt;Jeffrey Snover [MSFT] &lt;BR&gt;Distinguished Engineer &lt;BR&gt;Visit the Windows PowerShell Team blog at:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://blogs.msdn.com/PowerShell" mce_href="http://blogs.msdn.com/PowerShell"&gt;http://blogs.msdn.com/PowerShell&lt;/A&gt; &lt;BR&gt;Visit the Windows PowerShell ScriptCenter at:&amp;nbsp; &lt;A href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx" mce_href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9921338" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/powershell/attachment/9921338.ashx" length="2129641" type="application/vnd.openxmlformats-officedocument.pres" /></item><item><title>Windows Server 2008 R2 Rocks!</title><link>http://blogs.msdn.com/powershell/archive/2009/11/09/windows-server-2008-r2-rocks.aspx</link><pubDate>Mon, 09 Nov 2009 16:05:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9919585</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9919585.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9919585</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9919585</wfw:comment><description>&lt;p&gt;One of the things I like to say is that, “Microsoft is incapable of sustained error”.&amp;#160; By that I mean that Microsoft is an intensely self-conscious culture, fearless about confronting shortcomings and&amp;#160; constantly looking for ways to do things better.&amp;#160; We beat ourselves up pretty brutally about the shortcomings of Vista and committed ourselves to doing better going forward.&amp;#160; This is one of the reasons why Windows Server 2008 was such a good release.&amp;#160; We didn’t stop there, we raised the bar for Windows 7 and Windows Server 2008 R2.&lt;/p&gt;  &lt;p&gt;Part of that was the product itself.&amp;#160; Anyone that uses either of these products can see that immediately.&amp;#160; These are solid, high quality products.&amp;#160; We also raised the bar and teaching people about the release.&amp;#160; &lt;/p&gt;  &lt;p&gt;This morning, MSDN’s Channel9 opened up a new site for learning about WS08/R2 &lt;a href="http://channel9.msdn.com/learn/courses/WindowsServer2008R2/"&gt;HERE&lt;/a&gt;.&amp;#160; This site has lessons and short training videos for the following WS08/R2 topics:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Designed for Performance&lt;/li&gt;    &lt;li&gt;Designed for Efficiency&lt;/li&gt;    &lt;li&gt;Server Core .NET Application Server&lt;/li&gt;    &lt;li&gt;The Extensible Web Platform&lt;/li&gt;    &lt;li&gt;Extreme Web Services&lt;/li&gt;    &lt;li&gt;The Extensible File Classification Infrastructure&lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/"&gt;Windows PowerShell is Powerful Automation!&lt;/a&gt;&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;&lt;a href="http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/PowerShellV2forDevelopers/"&gt;Powershell V2 for Developers&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/PowerShell/"&gt;Windows PowerShell is Powerful Automation!&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/VPowerShell2/"&gt;Variables, Types, and Operators&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/VPowerShell3/"&gt;Array’s Conditionals, Collections, and Loops&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/VPowerShell4/"&gt;Create Object Cmdlets&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/VPowerShell5/"&gt;Remote Sessions&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/VPowerShell6"&gt;Advanced Remote Sessions&lt;/a&gt;&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;VHD and Hyper-V APIs Enable Creative New Solutions&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Much of this content if focused on developers but admin/It Pro scripters will find PowerShell section useful and appropriate.&lt;/p&gt;  &lt;p&gt;Experiment!&amp;#160; Enjoy!&amp;#160; Engage! &lt;/p&gt;  &lt;p&gt;Jeffrey Snover [MSFT]   &lt;br /&gt;Distinguished Engineer    &lt;br /&gt;Visit the Windows PowerShell Team blog at:&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://blogs.msdn.com/PowerShell"&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt;    &lt;br /&gt;Visit the Windows PowerShell ScriptCenter at:&amp;#160; &lt;a href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9919585" width="1" height="1"&gt;</description></item><item><title>PowerPack Challenge</title><link>http://blogs.msdn.com/powershell/archive/2009/11/05/powerpack-challenge.aspx</link><pubDate>Thu, 05 Nov 2009 16:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9918071</guid><dc:creator>PowerShellTeam</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/powershell/comments/9918071.aspx</comments><wfw:commentRss>http://blogs.msdn.com/powershell/commentrss.aspx?PostID=9918071</wfw:commentRss><wfw:comment>http://blogs.msdn.com/powershell/rsscomments.aspx?PostID=9918071</wfw:comment><description>&lt;P&gt;&lt;SPAN class=powerpackchallengeHeader&gt;&lt;STRONG&gt;Quest Software’s PowerPack Challenge’09&lt;/STRONG&gt;&lt;/SPAN&gt; is on... calling all script warriors to show their skills.&lt;/P&gt;
&lt;P&gt;See the details here - &lt;A href="http://powergui.org/powerpackchallenge.jspa"&gt;http://powergui.org/powerpackchallenge.jspa&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Happy Scritping&lt;/P&gt;
&lt;P&gt;Osama Sajid, Program Manager&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9918071" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/powershell/archive/tags/Quest/default.aspx">Quest</category></item></channel></rss>