<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Huddled Masses &#187; PowerUser</title>
	<atom:link href="http://joelbennett.net/tag/poweruser/feed/" rel="self" type="application/rss+xml" />
	<link>http://joelbennett.net</link>
	<description>The internet home of Joel "Jaykul" Bennett...</description>
	<lastBuildDate>Sat, 28 Jan 2012 21:37:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<cloud domain='joelbennett.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>What Scope Am I In?</title>
		<link>http://joelbennett.net/what-scope-am-i-in/</link>
		<comments>http://joelbennett.net/what-scope-am-i-in/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 06:28:11 +0000</pubDate>
		<dc:creator>Joel 'Jaykul' Bennett</dc:creator>
				<category><![CDATA[Huddled]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PowerUser]]></category>
		<category><![CDATA[Scope]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Variable Scope]]></category>

		<guid isPermaLink="false">http://huddledmasses.org/?p=1523</guid>
		<description><![CDATA[In PowerShell the question of scope is too complicated and convoluted. I&#8217;m going to try to help you understand it, but I&#8217;m not guaranteeing that I will be able to make it seem any simpler than it actually is. Hopefully, I won&#8217;t make it more complicated than it inherently is In PowerShell you always have [...]]]></description>
			<content:encoded><![CDATA[	<p>In PowerShell the question of scope is too complicated and convoluted. I&#8217;m going to try to help you understand it, but I&#8217;m not guaranteeing that I will be able to make it seem any simpler than it actually is. Hopefully, I won&#8217;t make it more complicated than it inherently is  <img src='http://joelbennett.net/wordpress/wp-includes/' alt=';-)' class='wp-smiley' /> </p>

	<p>In PowerShell you always have three named variable scopes: script, local and global. The default scope is always <strong>the same</strong> as the local scope, so when you set a variable without specifying the scope, it&#8217;s always set at local scope. One thing to note is that you can access these named scopes through the <code>$variable</code> notation, or through the variable drive, so all of the following are equivalent:</p>

	<div class="posh code posh" style="font-family:monospace;"><br />
<span style="color: #0066cc; font-style: italic;">Set-<span style="font-style: normal;">Variable</span></span> <span style="color: #666699; font-weight: bold;">var</span> <span style="color: #009900;">&quot;one&quot;</span> <span style="color: #000066;">-Scope</span> Local<br />
<span style="color: #660033; font-weight: bold;">$var</span> <span style="color: #66cc66;">=</span> <span style="color: #009900;">&quot;one&quot;</span><br />
<span style="color: #660033; font-weight: bold;">$local</span>:<span style="color: #666699; font-weight: bold;">var</span> <span style="color: #66cc66;">=</span> <span style="color: #009900;">&quot;one&quot;</span><br />
<span style="color: #0066cc; font-style: italic;">Set-<span style="font-style: normal;">Content</span></span> Variable::<span style="color: #003366;">Local</span>:<span style="color: #666699; font-weight: bold;">Var</span> <span style="color: #009900;">&quot;one&quot;</span><br />
&nbsp;</div>

	<p>A side note: the PSProvider drive notation means that when you&#8217;re in strict mode, if you want to test for the existence of a variable without causing an error, the simplest way to do it is with <code>Test-Path Variable:Var</code>&#8230;</p>

	<h3>What&#8217;s so hard about that?</h3>

	<p>Well, the question is: what scope are you in &#8220;right now&#8221; when a line of code is executing from a function or a script &#8230; </p>

	<p>Sometimes local scope is <span class="caps">ALSO</span> script scope, and sometimes, script scope is also global scope.  Specifically: when you&#8217;re typing at the console, all three scopes are the same. </p>

	<p>Let&#8217;s write a function to determine what named scope we&#8217;re in: </p>

	<div class="posh code posh" style="font-family:monospace;"><br />
<span style="color: #666699; font-weight: bold;">function</span> <span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">Scope</span></span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #0066cc; font-style: italic;">New-<span style="font-style: normal;">Variable</span></span> scope_test<br />
&nbsp; &nbsp;<span style="color: #0066cc; font-style: italic;">Write-<span style="font-style: normal;">Output</span></span> @<span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$GlobalScope</span> <span style="color: #66cc66;">=</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span><span style="color: #003366; font-weight: bold;">bool</span><span style="color: #333;">&#93;</span></span><span style="color: #333;">&#40;</span><span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">Variable</span></span> scope_test <span style="color: #000066;">-Scope</span> global <span style="color: #000066;">-ea</span> <span style="color: #cc66cc;">0</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$ScriptScope</span> <span style="color: #66cc66;">=</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span><span style="color: #003366; font-weight: bold;">bool</span><span style="color: #333;">&#93;</span></span><span style="color: #333;">&#40;</span><span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">Variable</span></span> scope_test <span style="color: #000066;">-Scope</span> script <span style="color: #000066;">-ea</span> <span style="color: #cc66cc;">0</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$LocalScope</span> <span style="color: #66cc66;">=</span> <span style="color: #660033; font-weight: bold;">$true</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span><br />
<span style="color: #333;">&#125;</span><br />
&nbsp;</div>

	<p>By setting a variable, and then testing the named scopes, we can verify what scope we were in when we set the variable. Of course, there&#8217;s no point testing the Local scope, because we already know that is where we are&#8230; then we return a hashtable of booleans indicating which scopes are active.</p>

	<p>If you dot-source that Get-Scope function, you&#8217;ll find the scope that you&#8217;re in where you dot-source it:</p>

	<ul>
		<li>if you do it at the interactive prompt it should tell you all three scopes are set</li>
		<li>if you do it in a script file it should tell you Local and Script</li>
		<li>but if you do it in a function, it will always just tell you &#8220;local&#8221; &#8212; and will not tell you if the function is in a script or not &#8230; nor how deep you are.</li>
	</ul>
	<ul>
		<li>and if you do it in a module, the results will depend on whether Find-Scope is defined in the module or not (this is very weird)</li>
	</ul>

	<h3>So are we done?</h3>

	<p>Not even remotely. On top of the named scopes, PowerShell also has nested scopes. Each script, function, scriptblock, etc. adds to the nested scopes, and takes you further from the global scope. On top of that, PowerShell has Modules. In a module, scope is flattened. Specifically, in a module, the default scope becomes the Script scope, which in this case is not actually reserved for a single file, but for any scripts, functions, etc that are executed from within that module&#8217;s context.</p>

	<p>To determine nesting level of the scope, we must do something like this:</p>

	<div class="posh code posh" style="font-family:monospace;"><br />
<span style="color: #666699; font-weight: bold;">function</span> <span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">ScopeDepth</span></span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">trap</span> <span style="color: #333;">&#123;</span> <span style="color: #666699; font-weight: bold;">continue</span> <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$depth</span> <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span><br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">do</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #0066cc; font-style: italic;">Set-<span style="font-style: normal;">Variable</span></span> scope_test <span style="color: #000066;">-Scope</span> <span style="color: #333;">&#40;</span><span style="color: #66cc66;">++</span><span style="color: #660033; font-weight: bold;">$depth</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span> <span style="color: #666699; font-weight: bold;">while</span><span style="color: #333;">&#40;</span>$?<span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">return</span> <span style="color: #660033; font-weight: bold;">$depth</span> <span style="color: #66cc66;">-</span> <span style="color: #cc66cc;">1</span><br />
<span style="color: #333;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Test it like this:</span><br />
. <span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">ScopeDepth</span></span><br />
<span style="color: #66cc66;">&amp;</span><span style="color: #333;">&#123;</span> . <span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">ScopeDepth</span></span> <span style="color: #333;">&#125;</span><br />
<span style="color: #66cc66;">&amp;</span><span style="color: #333;">&#123;</span> <span style="color: #66cc66;">&amp;</span><span style="color: #333;">&#123;</span> . <span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">ScopeDepth</span></span> <span style="color: #333;">&#125;</span> <span style="color: #333;">&#125;</span><br />
&nbsp;</div>

	<p>As long as modules aren&#8217;t involved, that will tell you how many scopes there are between you and global scope (and thus, return zero when dot-source from the console commandline).</p>

	<p>This falls apart a bit if you&#8217;re in a module (in a module, you can&#8217;t get to global scope by increasing the scope value &#8212; effectively, the highest you can go is script scope, but in reality you can still access global scope by naming it). To determine if you&#8217;re in a module, you can simply check for the existence of the <code>$PSScriptRoot</code> variable, or verify that <code>$Invocation.MyCommand.Module</code> is set to something.</p>

	<p>Additionally, if you&#8217;re in a module, you need to define this function <strong>in that module</strong> for it to work at all.</p>

	<p>There&#8217;s one more thing you could use to help you learn what scope you&#8217;re in, and that is the Get-PSCallStack cmdlet. This will tell you how many commands have been called to get you where you are. It&#8217;s <em>usually</em> the same as the Scope Depth, but not when it&#8217;s in a script file, etc.</p>

	<p>Here&#8217;s my finished scope digging function:</p>

	<div class="posh code posh" style="font-family:monospace;"><br />
<span style="color: #666699; font-weight: bold;">function</span> <span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">Scope</span></span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#91;</span>CmdletBinding<span style="color: #333;">&#40;</span><span style="color: #333;">&#41;</span><span style="color: #333;">&#93;</span><br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">Param</span><span style="color: #333;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #333;">&#91;</span>Parameter<span style="color: #333;">&#40;</span>Mandatory<span style="color: #66cc66;">=</span><span style="color: #660033; font-weight: bold;">$true</span><span style="color: #333;">&#41;</span><span style="color: #333;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>System.<span style="color: #003366;">Management</span>.<span style="color: #003366;">Automation</span>.<span style="color: #003366;">InvocationInfo</span><span style="color: #333;">&#93;</span></span><span style="color: #660033; font-weight: bold;">$Invocation</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#41;</span><br />
<br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">function</span> <span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">ScopeDepth</span></span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666699; font-weight: bold;">trap</span> <span style="color: #333;">&#123;</span> <span style="color: #666699; font-weight: bold;">continue</span> <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$depth</span> <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666699; font-weight: bold;">do</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066cc; font-style: italic;">Set-<span style="font-style: normal;">Variable</span></span> scope_test <span style="color: #000066;">-Scope</span> <span style="color: #333;">&#40;</span><span style="color: #66cc66;">++</span><span style="color: #660033; font-weight: bold;">$depth</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #333;">&#125;</span> <span style="color: #666699; font-weight: bold;">while</span><span style="color: #333;">&#40;</span>$?<span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666699; font-weight: bold;">return</span> <span style="color: #660033; font-weight: bold;">$depth</span> <span style="color: #66cc66;">-</span> <span style="color: #cc66cc;">1</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$depth</span> <span style="color: #66cc66;">=</span> <span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">ScopeDepth</span></span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp;<span style="color: #0066cc; font-style: italic;">Remove-<span style="font-style: normal;">Variable</span></span> scope_test<br />
&nbsp; &nbsp;<span style="color: #0066cc; font-style: italic;">New-<span style="font-style: normal;">Variable</span></span> scope_test<br />
<br />
&nbsp; &nbsp;<span style="color: #0066cc; font-style: italic;">New-<span style="font-style: normal;">Object</span></span> <span style="color: #003366; font-weight: bold;">PSObject</span> @<span style="color: #333;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; ModuleScope <span style="color: #66cc66;">=</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span><span style="color: #003366; font-weight: bold;">bool</span><span style="color: #333;">&#93;</span></span><span style="color: #660033; font-weight: bold;">$Invocation</span>.<span style="color: #003366;">MyCommand</span>.<span style="color: #003366;">Module</span><br />
&nbsp; &nbsp; &nbsp; GlobalScope <span style="color: #66cc66;">=</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span><span style="color: #003366; font-weight: bold;">bool</span><span style="color: #333;">&#93;</span></span><span style="color: #333;">&#40;</span><span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">Variable</span></span> scope_test <span style="color: #000066;">-Scope</span> global <span style="color: #000066;">-ea</span> <span style="color: #cc66cc;">0</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; ScriptScope <span style="color: #66cc66;">=</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span><span style="color: #003366; font-weight: bold;">bool</span><span style="color: #333;">&#93;</span></span><span style="color: #333;">&#40;</span><span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">Variable</span></span> scope_test <span style="color: #000066;">-Scope</span> script <span style="color: #000066;">-ea</span> <span style="color: #cc66cc;">0</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; ScopeDepth &nbsp;<span style="color: #66cc66;">=</span> <span style="color: #660033; font-weight: bold;">$depth</span><br />
&nbsp; &nbsp; &nbsp; PipelinePosition <span style="color: #66cc66;">=</span> <span style="color: #660033; font-weight: bold;">$Invocation</span>.<span style="color: #003366;">PipelinePosition</span><br />
&nbsp; &nbsp; &nbsp; PipelineLength <span style="color: #66cc66;">=</span> <span style="color: #660033; font-weight: bold;">$Invocation</span>.<span style="color: #003366;">PipelineLength</span><br />
&nbsp; &nbsp; &nbsp; CallStack <span style="color: #66cc66;">=</span> <span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">PSCallStack</span></span><br />
&nbsp; &nbsp; &nbsp; StackDepth <span style="color: #66cc66;">=</span> <span style="color: #333;">&#40;</span><span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">PSCallStack</span></span><span style="color: #333;">&#41;</span>.<span style="color: #003366;">Count</span> <span style="color: #66cc66;">-</span> <span style="color: #cc66cc;">1</span><br />
&nbsp; &nbsp; &nbsp; Invocation <span style="color: #66cc66;">=</span> <span style="color: #660033; font-weight: bold;">$Invocation</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span><br />
<span style="color: #333;">&#125;</span><br />
&nbsp;</div>

	<ul>
		<li>Remember: modules sometimes flatten scope.</li>
	</ul>
	<ul>
		<li>Remember: when calling this function you should dot-source it, and pass it $MyInvocation</li>
	</ul>

	<p>As as side note and counter-example, take for instance this module:</p>

	<div class="posh code posh" style="font-family:monospace;"><br />
<span style="color: #0066cc; font-style: italic;">New-<span style="font-style: normal;">Module</span></span> <span style="color: #333;">&#123;</span> <br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">function</span> <span style="color: #0066cc; font-style: italic;">test-<span style="font-style: normal;">scope</span></span> <span style="color: #333;">&#123;</span> . <span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">Scope</span></span> <span style="color: #660033; font-weight: bold;">$MyInvocation</span> <span style="color: #333;">&#125;</span> <br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">function</span> <span style="color: #0066cc; font-style: italic;">test-<span style="font-style: normal;">nestedscope</span></span> <span style="color: #333;">&#123;</span> <span style="color: #0066cc; font-style: italic;">test-<span style="font-style: normal;">scope</span></span> <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">function</span> <span style="color: #0066cc; font-style: italic;">test-<span style="font-style: normal;">nestednestedscope</span></span> <span style="color: #333;">&#123;</span> <span style="color: #0066cc; font-style: italic;">test-<span style="font-style: normal;">nestedscope</span></span> <span style="color: #333;">&#125;</span><br />
<span style="color: #333;">&#125;</span> <span style="color: #66cc66;">|</span> <span style="color: #0066cc; font-style: italic;">Import-<span style="font-style: normal;">Module</span></span><br />
&nbsp;</div>

	<p>All three of those functions will return ScopeDepth = 2 (the test-scope function, and the module itself), but the StackDepth will increase correctly. I don&#8217;t know why. It&#8217;s late, so I&#8217;m going to stop writing before I get <em>more</em> confusing.</p>]]></content:encoded>
			<wfw:commentRss>http://joelbennett.net/what-scope-am-i-in/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Import Binary Modules from Network Shares</title>
		<link>http://joelbennett.net/how-to-import-binary-modules-from-network-shares/</link>
		<comments>http://joelbennett.net/how-to-import-binary-modules-from-network-shares/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 06:15:04 +0000</pubDate>
		<dc:creator>Joel 'Jaykul' Bennett</dc:creator>
				<category><![CDATA[Huddled]]></category>
		<category><![CDATA[.Net4]]></category>
		<category><![CDATA[CAS]]></category>
		<category><![CDATA[FileShare]]></category>
		<category><![CDATA[Modules]]></category>
		<category><![CDATA[Policy]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PowerUser]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[UNC]]></category>

		<guid isPermaLink="false">http://huddledmasses.org/?p=1506</guid>
		<description><![CDATA[Note: This is from a wiki page I just wrote on Importing Binary Modules from Network Shares which discusses not just the solution below that works for .Net 2.0 but also how to solve the problem on .Net 4.0 (e.g.: in PoshConsole). I will most likely not keep this page up to date, so you [...]]]></description>
			<content:encoded><![CDATA[	<p><strong>Note:</strong> This is from a wiki page I just wrote on <a href="http://wiki.poshcode.org/FAQ/Problems_and_Gotchas/Importing_Binary_Modules_from_Network_Shares">Importing Binary Modules from Network Shares</a> which discusses not just the solution below that works for .Net 2.0 but also how to solve the problem on .Net 4.0 (e.g.: in PoshConsole).  I will most likely <em>not</em> keep this page up to date, so you should refer to that wiki if you need more information.</p>

	<p>Almost every author of a binary module has probably had someone ask about this at some point, because there&#8217;s always someone who has their user profiles stored on a network location, and therefore installed their modules on that network path and can&#8217;t get them to load because they get a warning that .Net &#8220;Failed to grant minimum permission requests.&#8221;</p>

	<p>Before we get into this any further let me just say: <strong>by far</strong> the simplest thing to do is to create a local folder on your local hard drive, add that to your environment PSPathModules variable, and just install your modules there.</p>

	<p>Other than that, the solution depends on the version of .Net that you&#8217;re using (you can tell by checking the $PSVersionTable.CLRVersion</p>

	<h3>The .Net 2.0 framework (and 3.0 and 3.5 and 3.5 SP1)</h3>

	<p>The problem is not a PowerShell problem at all, it&#8217;s a .Net problem. The .Net framework 2.0 (remember that PowerShell targets 2.0, and is actually based on .Net 1.1) didn&#8217;t trust assemblies loaded from network shares. You can fix that for an individual assembly or for a whole share using the <a title="http://msdn.microsoft.com/en-us/library/cb6t8dtz(VS.80).aspx" class=" external" rel="external nofollow" href="http://msdn.microsoft.com/en-us/library/cb6t8dtz%28VS.80%29.aspx" target="_blank">Caspol</a> tool.</p>

	<p>A complete discussion of that tool and it&#8217;s myriad command-line options is beyond me, but for a simple solution, you can run this command specifying the server and share you want to load from (in my example the &#8220;Modules&#8221; share on the &#8220;ProfileServer&#8221; server).</p>

	<div class="posh code posh" style="font-family:monospace;"><span style="color: #0066cc; font-style: italic;">Set-<span style="font-style: normal;">Alias</span></span> CasPol <span style="color: #009900;">&quot;$([Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory())CasPol.exe&quot;</span> <br />
CasPol <span style="color: #000066;">-pp</span> off <span style="color: #000066;">-machine</span> <span style="color: #000066;">-addgroup</span> <span style="color: #cc66cc;">1.2</span> <span style="color: #000066;">-url</span> file:<span style="color: #66cc66;">//</span>\ProfileServer\Modules\<span style="color: #66cc66;">*</span> FullTrust</div>

	<p>Hopefully the only thing that needs explaning there is that 1.2 is the default &#8220;Local Intranet&#8221; group, and that CasPol.exe is in your Framework Runtime directory. Once you&#8217;ve run that, you&#8217;ll be able to import any modules that are in subdirectories of that share.</p>

	<p><b>Note:</b> You <em>must</em> run the version of CasPol.exe which is in the lcation defined by the GetRuntimeDirectory() command (it&#8217;s important to use the same version as the runtime you want to be affected).</p>

	<p>You can read more about <a href="http://wiki.poshcode.org/FAQ/Problems_and_Gotchas/Importing_Binary_Modules_from_Network_Shares">importing binary modules from network shares</a>, including how it changed in .Net 3.5 SP1 and why it&#8217;s not automatically fixed in .Net 4 over on the PoshCode wiki.  <img src='http://joelbennett.net/wordpress/wp-includes/' alt=':)' class='wp-smiley' /> </p>]]></content:encoded>
			<wfw:commentRss>http://joelbennett.net/how-to-import-binary-modules-from-network-shares/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell PowerUser Tips: List the Cmdlets in an Assembly</title>
		<link>http://joelbennett.net/powershell-poweruser-tips-list-the-cmdlets-in-an-assembly/</link>
		<comments>http://joelbennett.net/powershell-poweruser-tips-list-the-cmdlets-in-an-assembly/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 05:07:54 +0000</pubDate>
		<dc:creator>Joel 'Jaykul' Bennett</dc:creator>
				<category><![CDATA[Huddled]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PowerTips]]></category>
		<category><![CDATA[PowerUser]]></category>
		<category><![CDATA[Reflection]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://HuddledMasses.org/?p=663</guid>
		<description><![CDATA[Tiny script&#8230; let me know if you know a better way. function Get-Cmdlets &#123; param&#40;&#91;System.Reflection.Assembly&#93;$assembly&#41; $assembly.GetTypes&#40;&#41; &#124; Where-Object &#123; &#160; &#160; &#160;$_.GetCustomAttributes&#40;&#91;System.Management.Automation.CmdletAttribute&#93;,$false&#41; &#125; &#124; ForEach-Object &#123; &#160; &#160; &#160;$type = $_ &#160; &#160; &#160;$_.GetCustomAttributes&#40;&#91;System.Management.Automation.CmdletAttribute&#93;,$false&#41; &#160; &#125; &#124; Select VerbName, NounName, @&#123;n=&#34;Type&#34;;e=&#123;$type&#125;&#125; &#124; &#125; ## Example usage. ## You can use the [System.Reflection.Assembly]::Load... methods to get [...]]]></description>
			<content:encoded><![CDATA[	<p>Tiny script&#8230; let me know if you know a better way.</p>

	<div class="posh code posh" style="font-family:monospace;"><br />
<span style="color: #666699; font-weight: bold;">function</span> <span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">Cmdlets</span></span> <span style="color: #333;">&#123;</span><br />
<span style="color: #666699; font-weight: bold;">param</span><span style="color: #333;">&#40;</span><span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>System.<span style="color: #003366;">Reflection</span>.<span style="color: #003366;">Assembly</span><span style="color: #333;">&#93;</span></span><span style="color: #660033; font-weight: bold;">$assembly</span><span style="color: #333;">&#41;</span><br />
<br />
<span style="color: #660033; font-weight: bold;">$assembly</span>.<span style="color: #003366;">GetTypes</span><span style="color: #333;">&#40;</span><span style="color: #333;">&#41;</span> <span style="color: #66cc66;">|</span> Where<span style="color: #66cc66;">-</span>Object <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$_</span>.<span style="color: #003366;">GetCustomAttributes</span><span style="color: #333;">&#40;</span><span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>System.<span style="color: #003366;">Management</span>.<span style="color: #003366;">Automation</span>.<span style="color: #003366;">CmdletAttribute</span><span style="color: #333;">&#93;</span></span>,<span style="color: #660033; font-weight: bold;">$false</span><span style="color: #333;">&#41;</span> <br />
<span style="color: #333;">&#125;</span> <span style="color: #66cc66;">|</span> ForEach<span style="color: #66cc66;">-</span>Object <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$type</span> <span style="color: #66cc66;">=</span> <span style="color: #660033; font-weight: bold;">$_</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$_</span>.<span style="color: #003366;">GetCustomAttributes</span><span style="color: #333;">&#40;</span><span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>System.<span style="color: #003366;">Management</span>.<span style="color: #003366;">Automation</span>.<span style="color: #003366;">CmdletAttribute</span><span style="color: #333;">&#93;</span></span>,<span style="color: #660033; font-weight: bold;">$false</span><span style="color: #333;">&#41;</span> &nbsp;<br />
<span style="color: #333;">&#125;</span> <span style="color: #66cc66;">|</span> <span style="color: #660033;">Select</span> VerbName, NounName, @<span style="color: #333;">&#123;</span>n<span style="color: #66cc66;">=</span><span style="color: #009900;">&quot;Type&quot;</span>;e<span style="color: #66cc66;">=</span><span style="color: #333;">&#123;</span><span style="color: #660033; font-weight: bold;">$type</span><span style="color: #333;">&#125;</span><span style="color: #333;">&#125;</span> <span style="color: #66cc66;">|</span> <br />
<span style="color: #333;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">## Example usage. </span><br />
<span style="color: #666666; font-style: italic;">## You can use the [System.Reflection.Assembly]::Load... methods to get an assembly</span><br />
<span style="color: #666666; font-style: italic;">## But for an example, use the &quot;CallingAssembly&quot; (System.Management.Automation )</span><br />
<span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">Cmdlets</span></span> <span style="color: #333;">&#40;</span><span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>System.<span style="color: #003366;">Reflection</span>.<span style="color: #003366;">Assembly</span><span style="color: #333;">&#93;</span></span>::<span style="color: #003366;">GetCallingAssembly</span><span style="color: #333;">&#40;</span><span style="color: #333;">&#41;</span><span style="color: #333;">&#41;</span> <span style="color: #66cc66;">|</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #660033;">Sort</span> VerbName, NounName <span style="color: #66cc66;">|</span> <span style="color: #0066cc; font-style: italic;">Format-<span style="font-style: normal;">Table</span></span> <span style="color: #000066;">-auto</span><br />
&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://joelbennett.net/powershell-poweruser-tips-list-the-cmdlets-in-an-assembly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell Power User Tips: Bash-style &#8220;alias&#8221; command.</title>
		<link>http://joelbennett.net/powershell-power-user-tips-bash-style-alias-command/</link>
		<comments>http://joelbennett.net/powershell-power-user-tips-bash-style-alias-command/#comments</comments>
		<pubDate>Sat, 03 May 2008 04:39:04 +0000</pubDate>
		<dc:creator>Joel 'Jaykul' Bennett</dc:creator>
				<category><![CDATA[Huddled]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PowerTips]]></category>
		<category><![CDATA[PowerUser]]></category>
		<category><![CDATA[PUT]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://HuddledMasses.org/powershell-power-user-tips-bash-style-alias-command/</guid>
		<description><![CDATA[I keep hearing from new users who are used to bash-style aliases, how frustrating it is not to be able to create aliases with parameters, the way you can in bash &#8230; I&#8217;m going to show you how to make the &#8220;alias&#8221; command work roughly the way it does in bash, but first, let me [...]]]></description>
			<content:encoded><![CDATA[	<p>I keep hearing from new users who are used to bash-style aliases, how frustrating it is not to be able to create aliases with parameters, the way you can in bash &#8230;</p>

	<p>I&#8217;m going to show you how to make the &#8220;alias&#8221; command work roughly the way it does in bash, but first, let me clear this up:</p>

	<table>
		<tr>
			<th>Bash or Csh </th>
			<th>PowerShell </th>
		</tr>
		<tr>
			<td> script </td>
			<td> script </td>
		</tr>
		<tr>
			<td> <a href="http://www.scit.wlv.ac.uk/cgi-bin/mansec?1+alias">alias</a>, <a href="http://www.faqs.org/docs/bashman/bashref_22.html">shell functions</a> </td>
			<td> function </td>
		</tr>
		<tr>
			<td> ... </td>
			<td> alias </td>
		</tr>
	</table>

	<p>In Bash, the recommendation is that &#8220;for almost every purpose, shell functions are preferred over aliases&#8221; ... and that recommendation is even stronger for PowerShell. The PowerShell &#8220;alias&#8221; is a true <em>alias</em> &#8212; it&#8217;s <em>just another name</em> for a command, script, function, etc. and it doesn&#8217;t support passing parameters or making mini-scripts at all. </p>

	<p>Usually, an alias serves to give you a name you can remember, but sometimes it&#8217;s just to shorten the name, .  Another use for them is to let you specify the default cmdlet &#8212; if you have two cmdlets (or script functions) with the same name, you can use an alias to override which one is executed by default.</p>

	<p>The PowerShell function can do everything a bash alias can do (and everything a function or script can do, but this isn&#8217;t a tip about that, it&#8217;s a tip about making an alias  <img src='http://joelbennett.net/wordpress/wp-includes/' alt='[new]' class='wp-smiley' />  and unalias command that works the way you expect it to).  So &#8230;</p>

	<div class="posh code posh" style="font-family:monospace;"><br />
<span style="color: #666666; font-style: italic;">## Aliases.ps1 -- to be dot-sourced from your profile</span><br />
<span style="color: #666699; font-weight: bold;">if</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$Host</span>.<span style="color: #003366;">Version</span>.<span style="color: #003366;">Major</span> <span style="color: #000066;">-ge</span> <span style="color: #cc66cc;">2</span><span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">function</span> script:<span style="color: #0066cc; font-style: italic;">Resolve-<span style="font-style: normal;">Aliases</span></span><br />
&nbsp; &nbsp;<span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666699; font-weight: bold;">param</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$line</span><span style="color: #333;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>System.<span style="color: #003366;">Management</span>.<span style="color: #003366;">Automation</span>.<span style="color: #003366;">PSParser</span><span style="color: #333;">&#93;</span></span>::<span style="color: #003366;">Tokenize</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$line</span>,<span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span><span style="color: #003366; font-weight: bold;">ref</span><span style="color: #333;">&#93;</span></span><span style="color: #660033; font-weight: bold;">$null</span><span style="color: #333;">&#41;</span> <span style="color: #66cc66;">|</span> <span style="color: #66cc66;">%</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">if</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$_</span>.<span style="color: #003366; font-weight: bold;">Type</span> <span style="color: #000066;">-eq</span> <span style="color: #009900;">&quot;Command&quot;</span><span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$cmd</span> <span style="color: #66cc66;">=</span> @<span style="color: #333;">&#40;</span>which <span style="color: #660033; font-weight: bold;">$_</span>.<span style="color: #003366;">Content</span><span style="color: #333;">&#41;</span><span style="color: #333;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #333;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666699; font-weight: bold;">if</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$cmd</span>.<span style="color: #003366;">CommandType</span> <span style="color: #000066;">-eq</span> <span style="color: #009900;">&quot;Alias&quot;</span><span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$line</span> <span style="color: #66cc66;">=</span> <span style="color: #660033; font-weight: bold;">$line</span>.<span style="color: #003366;">Remove</span><span style="color: #333;">&#40;</span> <span style="color: #660033; font-weight: bold;">$_</span>.<span style="color: #003366;">StartColumn</span> <span style="color: #66cc66;">-</span><span style="color: #cc66cc;">1</span>, <span style="color: #660033; font-weight: bold;">$_</span>.<span style="color: #003366;">Length</span> <span style="color: #333;">&#41;</span>.<span style="color: #003366;">Insert</span><span style="color: #333;">&#40;</span> <span style="color: #660033; font-weight: bold;">$_</span>.<span style="color: #003366;">StartColumn</span> <span style="color: #66cc66;">-</span><span style="color: #cc66cc;">1</span>, <span style="color: #660033; font-weight: bold;">$cmd</span>.<span style="color: #003366;">Definition</span> <span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$line</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span><br />
<span style="color: #333;">&#125;</span><br />
<br />
<span style="color: #666699; font-weight: bold;">function</span> alias <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #666666; font-style: italic;"># pull together all the args and then split on =</span><br />
&nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$alias</span>,<span style="color: #660033; font-weight: bold;">$cmd</span> <span style="color: #66cc66;">=</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span><span style="color: #003366; font-weight: bold;">string</span><span style="color: #333;">&#93;</span></span>::<span style="color: #333399; font-weight: bold; font-style: italic;">join</span><span style="color: #333;">&#40;</span><span style="color: #009900;">&quot; &quot;</span>,<span style="color: #660033; font-weight: bold;">$args</span><span style="color: #333;">&#41;</span>.<span style="color: #333399; font-weight: bold; font-style: italic;">split</span><span style="color: #333;">&#40;</span><span style="color: #009900;">&quot;=&quot;</span>,<span style="color: #cc66cc;">2</span><span style="color: #333;">&#41;</span> <span style="color: #66cc66;">|</span> <span style="color: #66cc66;">%</span> <span style="color: #333;">&#123;</span> <span style="color: #660033; font-weight: bold;">$_</span>.<span style="color: #003366;">trim</span><span style="color: #333;">&#40;</span><span style="color: #333;">&#41;</span><span style="color: #333;">&#125;</span><br />
<br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">if</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$Host</span>.<span style="color: #003366;">Version</span>.<span style="color: #003366;">Major</span> <span style="color: #000066;">-ge</span> <span style="color: #cc66cc;">2</span><span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$cmd</span> <span style="color: #66cc66;">=</span> <span style="color: #0066cc; font-style: italic;">Resolve-<span style="font-style: normal;">Aliases</span></span> <span style="color: #660033; font-weight: bold;">$cmd</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #0066cc; font-style: italic;">New-<span style="font-style: normal;">Item</span></span> <span style="color: #000066;">-Path</span> <span style="color: #666699; font-weight: bold;">function</span>: <span style="color: #000066;">-Name</span> <span style="color: #009900;">&quot;Global:Alias$Alias&quot;</span> <span style="color: #000066;">-Options</span> <span style="color: #009900;">&quot;AllScope&quot;</span> <span style="color: #000066;">-Value</span> @<span style="color: #009900;">&quot;<br />
Invoke-Expression '$cmd <span style="color: #000099; font-weight: bold;">`$</span>args'<br />
###ALIAS###<br />
&quot;</span>@<br />
<br />
&nbsp; &nbsp;<span style="color: #0066cc; font-style: italic;">Set-<span style="font-style: normal;">Alias</span></span> <span style="color: #000066;">-Name</span> <span style="color: #660033; font-weight: bold;">$Alias</span> <span style="color: #000066;">-Value</span> <span style="color: #009900;">&quot;Alias$Alias&quot;</span> <span style="color: #000066;">-Description</span> <span style="color: #009900;">&quot;A UNIX-style alias using functions&quot;</span> <span style="color: #000066;">-Option</span> <span style="color: #009900;">&quot;AllScope&quot;</span> <span style="color: #000066;">-scope</span> Global <span style="color: #000066;">-passThru</span><br />
<span style="color: #333;">&#125;</span><br />
<br />
<span style="color: #666699; font-weight: bold;">function</span> unalias<span style="color: #333;">&#40;</span><span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span><span style="color: #003366; font-weight: bold;">string</span><span style="color: #333;">&#93;</span></span><span style="color: #660033; font-weight: bold;">$Alias</span>,<span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span><span style="color: #666699; font-weight: bold;">switch</span><span style="color: #333;">&#93;</span></span><span style="color: #660033; font-weight: bold;">$Force</span><span style="color: #333;">&#41;</span><span style="color: #333;">&#123;</span> <br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">if</span><span style="color: #333;">&#40;</span> <span style="color: #333;">&#40;</span><span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">Alias</span></span> <span style="color: #660033; font-weight: bold;">$Alias</span><span style="color: #333;">&#41;</span>.<span style="color: #003366;">Description</span> <span style="color: #000066;">-eq</span> <span style="color: #009900;">&quot;A UNIX-style alias using functions&quot;</span> <span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0066cc; font-style: italic;">Remove-<span style="font-style: normal;">Item</span></span> <span style="color: #009900;">&quot;function:Alias$Alias&quot;</span> <span style="color: #000066;">-Force</span>:<span style="color: #660033; font-weight: bold;">$Force</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0066cc; font-style: italic;">Remove-<span style="font-style: normal;">Item</span></span> <span style="color: #009900;">&quot;alias:$alias&quot;</span> <span style="color: #000066;">-Force</span>:<span style="color: #660033; font-weight: bold;">$Force</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666699; font-weight: bold;">if</span><span style="color: #333;">&#40;</span>$?<span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&quot;Removed alias '$Alias' and accompanying function&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span> <span style="color: #666699; font-weight: bold;">else</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0066cc; font-style: italic;">Remove-<span style="font-style: normal;">Item</span></span> <span style="color: #009900;">&quot;alias:$alias&quot;</span> <span style="color: #000066;">-Force</span>:<span style="color: #660033; font-weight: bold;">$Force</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666699; font-weight: bold;">if</span><span style="color: #333;">&#40;</span>$?<span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&quot;Removed alias '$Alias'&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span><br />
<span style="color: #333;">&#125;</span></div>

	<p>You can save that as alias.ps1 and create your aliases the way you used to in bash <code>alias ls=&#39;ls -recurse&#39;</code> and still be able to invoke them and, <strong>you can pass them extra parameters</strong> somewhat like in csh when you invoke them.  <img src='http://joelbennett.net/wordpress/wp-includes/' alt=':-)' class='wp-smiley' />   I&#8217;ve added some extra text in the function name and content and in the alias description, so it&#8217;s actually pretty easy to find all the aliases and functions this script creates and dump them to a file so you can reload them later if you want &#8230; but I haven&#8217;t actually written a function to do that yet myself. </p>

	<p>One important note: You <strong>must</strong> not use recursive aliases in the bindings on v1 &#8212; that is, <code>alias ls=&#39;ls -recurse&#39;</code>  will loop until it hits PowerShell&#8217;s recursive limit (only 100) and exit if you try to use it on v1 &#8212; because the script won&#8217;t be able to resolve the alias &#8220;ls&#8221; to Get-ChildItem &#8230; you&#8217;re probably better off not relying on that feature anyway.</p>]]></content:encoded>
			<wfw:commentRss>http://joelbennett.net/powershell-power-user-tips-bash-style-alias-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

