<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: PowerShell Script: Get-Parameter</title>
	<atom:link href="http://halr9000.com/article/507/feed" rel="self" type="application/rss+xml" />
	<link>http://halr9000.com/article/507</link>
	<description>(powershell &#38; other stuff)</description>
	<lastBuildDate>Thu, 17 May 2012 06:21:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Eddie</title>
		<link>http://halr9000.com/article/507/comment-page-1#comment-8747</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Sat, 10 Mar 2012 19:10:26 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/507#comment-8747</guid>
		<description>I also tracked down and tested...

function Get-Parameter ($Cmdlet) {
    foreach ($paramset in (Get-Command $Cmdlet).ParameterSets){
       $Output = @()
foreach ($paramset in (Get-Command $Cmdlet).ParameterSets){
	$Output = @()
	foreach ($param in $paramset.Parameters) {
		$process = &quot;&quot; &#124; Select-Object Name, ParameterSet, Aliases, IsMandatory, CommonParameter
		$process.Name = $param.Name
		if ( $paramset.name -eq &quot;__AllParameterSets&quot; ) { $process.ParameterSet = &quot;Default&quot; }
		else { $process.ParameterSet = $paramset.Name }
		$process.Aliases = $param.aliases
		$process.IsMandatory = $param.IsMandatory 
		if ($param.aliases -match &quot;vb&#124;db&#124;ea&#124;wa&#124;ev&#124;wv&#124;ov&#124;ob&quot;) { $process.CommonParameter = $TRUE }
		else { $process.CommonParameter = $FALSE }
		$output += $process
	}
	Write-Output $Output
	Write-Host &quot;`n&quot;
}



Still no luck</description>
		<content:encoded><![CDATA[<p>I also tracked down and tested&#8230;</p>
<p>function Get-Parameter ($Cmdlet) {<br />
    foreach ($paramset in (Get-Command $Cmdlet).ParameterSets){<br />
       $Output = @()<br />
foreach ($paramset in (Get-Command $Cmdlet).ParameterSets){<br />
	$Output = @()<br />
	foreach ($param in $paramset.Parameters) {<br />
		$process = &#8220;&#8221; | Select-Object Name, ParameterSet, Aliases, IsMandatory, CommonParameter<br />
		$process.Name = $param.Name<br />
		if ( $paramset.name -eq &#8220;__AllParameterSets&#8221; ) { $process.ParameterSet = &#8220;Default&#8221; }<br />
		else { $process.ParameterSet = $paramset.Name }<br />
		$process.Aliases = $param.aliases<br />
		$process.IsMandatory = $param.IsMandatory<br />
		if ($param.aliases -match &#8220;vb|db|ea|wa|ev|wv|ov|ob&#8221;) { $process.CommonParameter = $TRUE }<br />
		else { $process.CommonParameter = $FALSE }<br />
		$output += $process<br />
	}<br />
	Write-Output $Output<br />
	Write-Host &#8220;`n&#8221;<br />
}</p>
<p>Still no luck</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://halr9000.com/article/507/comment-page-1#comment-8746</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Sat, 10 Mar 2012 18:51:14 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/507#comment-8746</guid>
		<description>You have many of us taking wild guesses on how to make this function work. Please post the complete info. I would like to add a line of code to my Powershell Profile. I have tried both the ps1 and adding the function to my Profile. 

#added to profile
function gpm ($Cmdlet) { Get-Parameter $Cmdlet &#124; ft name,type,is*,pipe* -GroupBy parameterset -AutoSize }

#ps1 file
function Get-Parameter ( $Cmdlet, [switch]$ShowCommon, [switch]$Full ) {

	$command = Get-Command $Cmdlet -ea silentlycontinue 

	# resolve aliases (an alias can point to another alias)
	while ($command.CommandType -eq &quot;Alias&quot;) {
		$command = Get-Command ($command.definition)
	}
	if (-not $command) { return }

	foreach ($paramset in $command.ParameterSets){
		$Output = @()
		foreach ($param in $paramset.Parameters) {
			if ( ! $ShowCommon ) {
				if ($param.aliases -match &quot;vb&#124;db&#124;ea&#124;wa&#124;ev&#124;wv&#124;ov&#124;ob&#124;wi&#124;cf&quot;) { continue }
			}
			$process = &quot;&quot; &#124; Select-Object Name, Type, ParameterSet, Aliases, Position, IsMandatory,
			Pipeline, PipelineByPropertyName
			$process.Name = $param.Name
			if ( $param.ParameterType.Name -eq &quot;SwitchParameter&quot; ) {
				$process.Type = &quot;Boolean&quot;
			}
			else {
				switch -regex ( $param.ParameterType ) {
					&quot;Nullable``1\[(.+)\]&quot; { $process.Type = $matches[1].Split(&#039;.&#039;)[-1] + &quot; (nullable)&quot; ; break }
					default { $process.Type = $param.ParameterType.Name }
				}
			}
			if ( $paramset.name -eq &quot;__AllParameterSets&quot; ) { $process.ParameterSet = &quot;Default&quot; }
			else { $process.ParameterSet = $paramset.Name }
			$process.Aliases = $param.aliases
			if ( $param.Position -lt 0 ) { $process.Position = $null }
			else { $process.Position = $param.Position }
			$process.IsMandatory = $param.IsMandatory
			$process.Pipeline = $param.ValueFromPipeline
			$process.PipelineByPropertyName = $param.ValueFromPipelineByPropertyName
			$output += $process
		}
		if ( ! $Full ) { 
			$Output &#124; Select-Object Name, Type, ParameterSet, IsMandatory, Pipeline
		}
		else { Write-Output $Output }
	}
}</description>
		<content:encoded><![CDATA[<p>You have many of us taking wild guesses on how to make this function work. Please post the complete info. I would like to add a line of code to my Powershell Profile. I have tried both the ps1 and adding the function to my Profile. </p>
<p>#added to profile<br />
function gpm ($Cmdlet) { Get-Parameter $Cmdlet | ft name,type,is*,pipe* -GroupBy parameterset -AutoSize }</p>
<p>#ps1 file<br />
function Get-Parameter ( $Cmdlet, [switch]$ShowCommon, [switch]$Full ) {</p>
<p>	$command = Get-Command $Cmdlet -ea silentlycontinue </p>
<p>	# resolve aliases (an alias can point to another alias)<br />
	while ($command.CommandType -eq &#8220;Alias&#8221;) {<br />
		$command = Get-Command ($command.definition)<br />
	}<br />
	if (-not $command) { return }</p>
<p>	foreach ($paramset in $command.ParameterSets){<br />
		$Output = @()<br />
		foreach ($param in $paramset.Parameters) {<br />
			if ( ! $ShowCommon ) {<br />
				if ($param.aliases -match &#8220;vb|db|ea|wa|ev|wv|ov|ob|wi|cf&#8221;) { continue }<br />
			}<br />
			$process = &#8220;&#8221; | Select-Object Name, Type, ParameterSet, Aliases, Position, IsMandatory,<br />
			Pipeline, PipelineByPropertyName<br />
			$process.Name = $param.Name<br />
			if ( $param.ParameterType.Name -eq &#8220;SwitchParameter&#8221; ) {<br />
				$process.Type = &#8220;Boolean&#8221;<br />
			}<br />
			else {<br />
				switch -regex ( $param.ParameterType ) {<br />
					&#8220;Nullable&#8220;1\[(.+)\]&#8221; { $process.Type = $matches[1].Split(&#8216;.&#8217;)[-1] + &#8221; (nullable)&#8221; ; break }<br />
					default { $process.Type = $param.ParameterType.Name }<br />
				}<br />
			}<br />
			if ( $paramset.name -eq &#8220;__AllParameterSets&#8221; ) { $process.ParameterSet = &#8220;Default&#8221; }<br />
			else { $process.ParameterSet = $paramset.Name }<br />
			$process.Aliases = $param.aliases<br />
			if ( $param.Position -lt 0 ) { $process.Position = $null }<br />
			else { $process.Position = $param.Position }<br />
			$process.IsMandatory = $param.IsMandatory<br />
			$process.Pipeline = $param.ValueFromPipeline<br />
			$process.PipelineByPropertyName = $param.ValueFromPipelineByPropertyName<br />
			$output += $process<br />
		}<br />
		if ( ! $Full ) {<br />
			$Output | Select-Object Name, Type, ParameterSet, IsMandatory, Pipeline<br />
		}<br />
		else { Write-Output $Output }<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Random Letters &#124; TechProsaic</title>
		<link>http://halr9000.com/article/507/comment-page-1#comment-7520</link>
		<dc:creator>Random Letters &#124; TechProsaic</dc:creator>
		<pubDate>Sun, 24 Jan 2010 05:47:53 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/507#comment-7520</guid>
		<description>[...] However, there is an easier way. Let’s go back a step and have a look at Get-Random’s second mode. Here is a table showing the two parameter sets (output created with my Get-Parameter script): [...]</description>
		<content:encoded><![CDATA[<p>[...] However, there is an easier way. Let’s go back a step and have a look at Get-Random’s second mode. Here is a table showing the two parameter sets (output created with my Get-Parameter script): [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: halr9000</title>
		<link>http://halr9000.com/article/507/comment-page-1#comment-7309</link>
		<dc:creator>halr9000</dc:creator>
		<pubDate>Fri, 25 Sep 2009 18:08:53 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/507#comment-7309</guid>
		<description>Guys, I&#039;ve updated the script to work &quot;standalone&quot; instead of as a function.  Download the new version and it should work as you are expecting.</description>
		<content:encoded><![CDATA[<p>Guys, I&#8217;ve updated the script to work &#8220;standalone&#8221; instead of as a function.  Download the new version and it should work as you are expecting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kenneth</title>
		<link>http://halr9000.com/article/507/comment-page-1#comment-7297</link>
		<dc:creator>Kenneth</dc:creator>
		<pubDate>Fri, 25 Sep 2009 12:57:52 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/507#comment-7297</guid>
		<description>Hi Brian,

To be honest I don&#039;t know if I got this to work or if I just skipped this part in the book ;)

Kenneth</description>
		<content:encoded><![CDATA[<p>Hi Brian,</p>
<p>To be honest I don&#8217;t know if I got this to work or if I just skipped this part in the book <img src='http://halr9000.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Kenneth</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Reck</title>
		<link>http://halr9000.com/article/507/comment-page-1#comment-7296</link>
		<dc:creator>Brian Reck</dc:creator>
		<pubDate>Fri, 25 Sep 2009 12:31:24 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/507#comment-7296</guid>
		<description>Kenneth,

Have you had any luck with this?. I am having the same issue - no output!
I am running : .\Get-Parameter.ps1 Get-EventLog

Thanks
Brian</description>
		<content:encoded><![CDATA[<p>Kenneth,</p>
<p>Have you had any luck with this?. I am having the same issue &#8211; no output!<br />
I am running : .\Get-Parameter.ps1 Get-EventLog</p>
<p>Thanks<br />
Brian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: halr9000</title>
		<link>http://halr9000.com/article/507/comment-page-1#comment-7158</link>
		<dc:creator>halr9000</dc:creator>
		<pubDate>Fri, 07 Aug 2009 13:55:50 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/507#comment-7158</guid>
		<description>Kenneth, what you need to do is to dot-source the file first, and then you&#039;ll have a get-parameter function available for use.  There&#039;s pros and cons, but I basically decided to distribute the script this way as a part of how I organize smaller scripts into modular pieces which are loaded in every powershell session from my profile.  You can read more about dot-sourcing here: http://www.microsoft.com/technet/scriptcenter/topics/winpsh/manual/run.mspx#EMBAC</description>
		<content:encoded><![CDATA[<p>Kenneth, what you need to do is to dot-source the file first, and then you&#8217;ll have a get-parameter function available for use.  There&#8217;s pros and cons, but I basically decided to distribute the script this way as a part of how I organize smaller scripts into modular pieces which are loaded in every powershell session from my profile.  You can read more about dot-sourcing here: <a href="http://www.microsoft.com/technet/scriptcenter/topics/winpsh/manual/run.mspx#EMBAC" rel="nofollow">http://www.microsoft.com/technet/scriptcenter/topics/winpsh/manual/run.mspx#EMBAC</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kenneth</title>
		<link>http://halr9000.com/article/507/comment-page-1#comment-7155</link>
		<dc:creator>Kenneth</dc:creator>
		<pubDate>Thu, 06 Aug 2009 11:36:28 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/507#comment-7155</guid>
		<description>I think I&#039;m missing out on something. I&#039;m going through the book (compliments so far!) and reached the section in where this get-parameter script is discussed. The ouput of the scripts keeps on coming back in the book.

My problem now is that the script won&#039;t give me any output at all.
For example: .\Get-Parameter.ps1 get-eventlog

doesn&#039;t show me anything. I&#039;ve tried different kinds of approaches but never got the output as shown in the book.

Please advice in what I am doing wrong here?

Many Thanks!
Kenneth</description>
		<content:encoded><![CDATA[<p>I think I&#8217;m missing out on something. I&#8217;m going through the book (compliments so far!) and reached the section in where this get-parameter script is discussed. The ouput of the scripts keeps on coming back in the book.</p>
<p>My problem now is that the script won&#8217;t give me any output at all.<br />
For example: .\Get-Parameter.ps1 get-eventlog</p>
<p>doesn&#8217;t show me anything. I&#8217;ve tried different kinds of approaches but never got the output as shown in the book.</p>
<p>Please advice in what I am doing wrong here?</p>
<p>Many Thanks!<br />
Kenneth</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: halr9000</title>
		<link>http://halr9000.com/article/507/comment-page-1#comment-6759</link>
		<dc:creator>halr9000</dc:creator>
		<pubDate>Mon, 30 Jun 2008 17:37:57 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/507#comment-6759</guid>
		<description>thanks dude, good work!</description>
		<content:encoded><![CDATA[<p>thanks dude, good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oisin G.</title>
		<link>http://halr9000.com/article/507/comment-page-1#comment-6758</link>
		<dc:creator>Oisin G.</dc:creator>
		<pubDate>Mon, 30 Jun 2008 16:55:10 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/507#comment-6758</guid>
		<description>Hey Hal,

Nice script! I tweaked it a little to handle aliases (including aliases to aliases). (v.91)

- Oisin</description>
		<content:encoded><![CDATA[<p>Hey Hal,</p>
<p>Nice script! I tweaked it a little to handle aliases (including aliases to aliases). (v.91)</p>
<p>- Oisin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Episode 31 &#8211; Money for Nothin&#8217; and Tips for Free &#171; PowerScripting Podcast</title>
		<link>http://halr9000.com/article/507/comment-page-1#comment-6757</link>
		<dc:creator>Episode 31 &#8211; Money for Nothin&#8217; and Tips for Free &#171; PowerScripting Podcast</dc:creator>
		<pubDate>Mon, 30 Jun 2008 13:20:08 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/507#comment-6757</guid>
		<description>[...] Hal has a script up called Get-Parameter. [...]</description>
		<content:encoded><![CDATA[<p>[...] Hal has a script up called Get-Parameter. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

