<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>The Lonely Administrator</title>
	
	<link>http://jdhitsolutions.com/blog</link>
	<description>Advice, solutions, tips and more for the lonely Windows administrator with too much to do and not enough time.</description>
	<lastBuildDate>Tue, 29 May 2012 13:16:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/JeffsScriptingBlogAndMore" /><feedburner:info uri="jeffsscriptingblogandmore" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Get My Variable Revisited</title>
		<link>http://feedproxy.google.com/~r/JeffsScriptingBlogAndMore/~3/oboJDhMC62M/</link>
		<comments>http://jdhitsolutions.com/blog/2012/05/get-my-variable-revisited/#comments</comments>
		<pubDate>Tue, 29 May 2012 13:16:27 +0000</pubDate>
		<dc:creator>Jeffery Hicks</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Variable]]></category>

		<guid isPermaLink="false">http://jdhitsolutions.com/blog/?p=2350</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
Last year I wrote a few articles on working with variables. One task I needed was to identify the variables that I had created in a given PowerShell session with a function I wrote called Get-MyVariable. I also posted an &#8230; <a href="http://jdhitsolutions.com/blog/2012/05/get-my-variable-revisited/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDExLzEwL3RhbGtidWJibGUucG5nI3V0bV9zb3VyY2U9ZmVlZCZhbXA7dXRtX21lZGl1bT1mZWVkJmFtcDt1dG1fY2FtcGFpZ249ZmVlZA=="><img src="http://jdhitsolutions.com/blog/wp-content/uploads/2011/10/talkbubble-150x150.png" alt="" title="talkbubble" width="150" height="150" class="alignleft size-thumbnail wp-image-1688" /></a>Last year I wrote a few articles on working with variables. One task I needed was to identify the variables that I had created in a given PowerShell session with a function I wrote called <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTEvMDMvZ2V0LW15LXZhcmlhYmxlcy8jdXRtX3NvdXJjZT1mZWVkJmFtcDt1dG1fbWVkaXVtPWZlZWQmYW1wO3V0bV9jYW1wYWlnbj1mZWVk" target=\"_blank\">Get-MyVariable</a>. I also posted an article on <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDEvZnJpZGF5LWZ1bi13aGF0cy1teS12YXJpYWJsZS8jdXRtX3NvdXJjZT1mZWVkJmFtcDt1dG1fbWVkaXVtPWZlZWQmYW1wO3V0bV9jYW1wYWlnbj1mZWVk" target=\"_blank\">identifying the object type</a> for a variable value. While trying to find something today I realized I could combine the two ideas.</p>
<p>One approach would be to leave my original function alone. When I need the variable value type, I could simply to this:</p>
<div class="codecolorer-container dos geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PS C:\<span style="color: #33cc33;">&gt;</span> get-myvariable <span style="color: #33cc33;">|</span> Select Name,Value,<span style="color: #33cc33;">@</span>{Name=&quot;Type&quot;,Expression={$_.Value.GetType<span style="color: #33cc33;">()</span>.Name}}<br />
<br />
Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Value &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Type<br />
---- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ----- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;----<br />
a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5/28/2012 8:45:25 AM &nbsp; &nbsp; &nbsp; DateTime<br />
bigp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ps <span style="color: #33cc33;">|</span> where {$_.ws -gt 1... ScriptBlock<br />
cert &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [Subject]... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; X509Certificate2<br />
dirt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Param<span style="color: #33cc33;">(</span>[string]$Path=$en... ScriptBlock<br />
...</div></div>
<p>See the value in having a function that writes to the pipeline? However, I wanted this to be the default behavior so I decided to incorporate it into my original function. I also realized that there may be situations where I don&#8217;t want this information so I added a -NoTypeInformation switch parameter. The changes to my original function were minimal.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;">#filter out some automatic variables</span><br />
<span style="color: #800080;">$filtered</span><span style="color: pink;">=</span><span style="color: #800080;">$variables</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span><span style="color: #800080;">$psvariables</span> <span style="color: #FF0000;">-notcontains</span> <span style="color: #000080;">$_</span>.name <span style="color: #FF0000;">-AND</span> <span style="color: #000080;">$_</span>.name <span style="color: #FF0000;">-notmatch</span> <span style="color: #800080;">$skip</span><span style="color: #000000;">&#125;</span> <br />
&nbsp; &nbsp; &nbsp; <br />
<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$NoTypeInformation</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #008000;">#write results with not object types</span><br />
&nbsp;<span style="color: #800080;">$filtered</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #0000FF;">else</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #008000;">#add type information for each variable</span><br />
&nbsp; <span style="color: #008080; font-weight: bold;">Write-Verbose</span> <span style="color: #800000;">&quot;Adding value type&quot;</span><br />
&nbsp; <span style="color: #800080;">$filtered</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Select-Object</span> Name<span style="color: pink;">,</span>Value<span style="color: pink;">,@</span><span style="color: #000000;">&#123;</span>Name<span style="color: pink;">=</span><span style="color: #800000;">&quot;Type&quot;</span>;Expression<span style="color: pink;">=</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.Value.GetType<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.Name<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p>Now, I can run a command like this:</p>
<div class="codecolorer-container dos geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PS S:\<span style="color: #33cc33;">&gt;</span> get-myvariable <span style="color: #33cc33;">|</span> where {$_.type -eq &quot;Scriptblock&quot;} <span style="color: #33cc33;">|</span> Select name<br />
<br />
Name<br />
----<br />
bigp<br />
dc01<br />
dirt<br />
disk<br />
doy<br />
run<br />
up</div></div>
<p>I suppose I could further refine the function to do filtering in place for a specific type. But I&#8217;ll leave that exercise to you.</p>
<p>Download <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L0dldC1NeVZhcmlhYmxlMi50eHQ=">Get-MyVariable2</a> and try it out for yourself.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL2ludGVudC90d2VldD90ZXh0PUdldCtNeStWYXJpYWJsZStSZXZpc2l0ZWQraHR0cCUzQSUyRiUyRmpkaGl0c29sdXRpb25zLmNvbSUyRmJsb2clMkYyMDEyJTJGMDUlMkZnZXQtbXktdmFyaWFibGUtcmV2aXNpdGVkJTJG" title=\"Post to Twitter\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter6.png" alt="Post to Twitter" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BsdXJrLmNvbS8/c3RhdHVzPSU1QkJMQU5LJTVE" title=\"Post to Plurk\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/plurk/tt-plurk.png" alt="Post to Plurk" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2J1enoueWFob28uY29tL2J1eno/dGFyZ2V0VXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L2dldC1teS12YXJpYWJsZS1yZXZpc2l0ZWQvJmFtcDtoZWFkbGluZT1HZXQrTXkrVmFyaWFibGUrUmV2aXNpdGVk" title=\"Post to Yahoo Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/buzz/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RlbGljaW91cy5jb20vcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZ2V0LW15LXZhcmlhYmxlLXJldmlzaXRlZC8mYW1wO3RpdGxlPUdldCtNeStWYXJpYWJsZStSZXZpc2l0ZWQ=" title=\"Post to Delicious\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RpZ2cuY29tL3N1Ym1pdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZ2V0LW15LXZhcmlhYmxlLXJldmlzaXRlZC8mYW1wO3RpdGxlPUdldCtNeStWYXJpYWJsZStSZXZpc2l0ZWQ=" title=\"Post to Digg\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="Post to Digg" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mYWNlYm9vay5jb20vc2hhcmUucGhwP3U9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZ2V0LW15LXZhcmlhYmxlLXJldmlzaXRlZC8mYW1wO3Q9R2V0K015K1ZhcmlhYmxlK1JldmlzaXRlZA==" title=\"Post to Facebook\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mcmllbmRmZWVkLmNvbS9zaGFyZT90aXRsZT1HZXQrTXkrVmFyaWFibGUrUmV2aXNpdGVkJmFtcDtsaW5rPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L2dldC1teS12YXJpYWJsZS1yZXZpc2l0ZWQv" title=\"Post to FriendFeed\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ff/tt-ff.png" alt="Post to FriendFeed" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL2J1enovcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZ2V0LW15LXZhcmlhYmxlLXJldmlzaXRlZC8mYW1wO2ltYWdldXJsPQ==" title=\"Post to Google Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/gbuzz/tt-gbuzz.png" alt="Post to Google Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BpbmcuZm0vcmVmLz9tZXRob2Q9bWljcm9ibG9nJmFtcDt0aXRsZT1HZXQrTXkrVmFyaWFibGUrUmV2aXNpdGVkJmFtcDtsaW5rPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L2dldC1teS12YXJpYWJsZS1yZXZpc2l0ZWQv" title=\"Post to Ping.fm\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ping/tt-ping.png" alt="Post to Ping.fm" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JlZGRpdC5jb20vc3VibWl0P3VybD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9nZXQtbXktdmFyaWFibGUtcmV2aXNpdGVkLyZhbXA7dGl0bGU9R2V0K015K1ZhcmlhYmxlK1JldmlzaXRlZA==" title=\"Post to Reddit\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NsYXNoZG90Lm9yZy9ib29rbWFyay5wbD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZ2V0LW15LXZhcmlhYmxlLXJldmlzaXRlZC8mYW1wO3RpdGxlPUdldCtNeStWYXJpYWJsZStSZXZpc2l0ZWQ=" title=\"Post to Slashdot\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/slashdot/tt-slashdot.png" alt="Post to Slashdot" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dW1ibGV1cG9uLmNvbS9zdWJtaXQ/dXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L2dldC1teS12YXJpYWJsZS1yZXZpc2l0ZWQvJmFtcDt0aXRsZT1HZXQrTXkrVmFyaWFibGUrUmV2aXNpdGVk" title=\"Post to StumbleUpon\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL2ZhdmVzP2FkZD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9nZXQtbXktdmFyaWFibGUtcmV2aXNpdGVkLw==" title=\"Post to Technorati\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/technorati/tt-technorati.png" alt="Post to Technorati" /></a></p></div> <img src="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2350" width="1" height="1" style="display: none;" />
<p><a href="http://feedads.g.doubleclick.net/~a/edmEQrXdjIk0REajYF2n5UtRepQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/edmEQrXdjIk0REajYF2n5UtRepQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/edmEQrXdjIk0REajYF2n5UtRepQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/edmEQrXdjIk0REajYF2n5UtRepQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/oboJDhMC62M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jdhitsolutions.com/blog/2012/05/get-my-variable-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jdhitsolutions.com/blog/2012/05/get-my-variable-revisited/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=get-my-variable-revisited</feedburner:origLink></item>
		<item>
		<title>Query Local Administrators with CIM</title>
		<link>http://feedproxy.google.com/~r/JeffsScriptingBlogAndMore/~3/2JooSWs2_ZY/</link>
		<comments>http://jdhitsolutions.com/blog/2012/05/query-local-administrators-with-cim/#comments</comments>
		<pubDate>Thu, 24 May 2012 14:12:25 +0000</pubDate>
		<dc:creator>Jeffery Hicks</dc:creator>
				<category><![CDATA[Powershell 3.0]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[CIM]]></category>
		<category><![CDATA[Get-CIMInstance]]></category>
		<category><![CDATA[PowerShell 3.0]]></category>

		<guid isPermaLink="false">http://jdhitsolutions.com/blog/?p=2342</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
Yesterday I posted an article on listing members of the local administrators group with PowerShell and Get-WmiObject. PowerShell 3.0 offers an additional way using the CIM cmdlets. The CIM cmdlets query the same WMI information, except instead of using the &#8230; <a href="http://jdhitsolutions.com/blog/2012/05/query-local-administrators-with-cim/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L3RhbGtidWJibGUtdjMucG5nI3V0bV9zb3VyY2U9ZmVlZCZhbXA7dXRtX21lZGl1bT1mZWVkJmFtcDt1dG1fY2FtcGFpZ249ZmVlZA=="><img src="http://jdhitsolutions.com/blog/wp-content/uploads/2012/05/talkbubble-v3-150x150.png" alt="" title="talkbubble-v3" width="150" height="150" class="alignleft size-thumbnail wp-image-2345" /></a><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVlcnktbG9jYWwtYWRtaW5pc3RyYXRvcnMtd2l0aC13bWkvI3V0bV9zb3VyY2U9ZmVlZCZhbXA7dXRtX21lZGl1bT1mZWVkJmFtcDt1dG1fY2FtcGFpZ249ZmVlZA==" title=\"Read the first article\" target=\"_blank\">Yesterday </a>I posted an article on listing members of the local administrators group with PowerShell and Get-WmiObject. PowerShell 3.0 offers an additional way using the CIM cmdlets. The CIM cmdlets query the same WMI information, except instead of using the traditional RPC/DCOM connection, these cmdlets utilize PowerShell&#8217;s remoting endpoint so they are much more firewall friendly and a little faster in my testing. I&#8217;ll be covering these cmdlets over time as PowerShell v3 is released. </p>
<p>The code I wrote yesterday can be re-used with only a few modifications. We can still easily get the group object.</p>
<div class="codecolorer-container dos geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PS C:\<span style="color: #33cc33;">&gt;</span> Get-CimInstance Win32_Group -filter &quot;Name='Administrators'&quot; -computername 'Quark'<br />
<br />
SID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Caption &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Domain<br />
--- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;---- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ------- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;------<br />
S-1-5-32-544 &nbsp; &nbsp; &nbsp; &nbsp; Administrators &nbsp; QUARK\Administrators QUARK</div></div>
<p>We can connect either by a computername or a CIMSession. We still need to get associated objects. There is a cmdlet called Get-CIMAssociatedInstance which you could use like this:</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Get<span style="color: pink;">-</span>CimInstance Win32_Group <span style="color: pink;">-</span><span style="color: #0000FF;">filter</span> <span style="color: #800000;">&quot;Name='Administrators'&quot;</span> <span style="color: #008080; font-style: italic;">-computername</span> <span style="color: #800000;">'Quark'</span> <span style="color: pink;">|</span> Get<span style="color: pink;">-</span>CimAssociatedInstance <span style="color: #008080; font-style: italic;">-ComputerName</span> <span style="color: #800000;">'Quark'</span></div></div>
<p>However, this will return all associations and I have not been able to find a way with this cmdlet to limit results to user and group objects as I did with WMI. However, we can still use the Associators Of query.</p>
<div class="codecolorer-container dos geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PS C:\<span style="color: #33cc33;">&gt;</span> $computer='Quark'<br />
PS C:\<span style="color: #33cc33;">&gt;</span> $query=&quot;Associators of {Win32_Group.Domain='$computer',Name='Administrators'} where Role=GroupComponent&quot;<br />
PS C:\<span style="color: #33cc33;">&gt;</span> Get-CimInstance -Query $query -ComputerName $computer<br />
<br />
Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Caption &nbsp; &nbsp; &nbsp; &nbsp; AccountType &nbsp; &nbsp; SID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Domain<br />
---- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ------- &nbsp; &nbsp; &nbsp; &nbsp; ----------- &nbsp; &nbsp; --- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ------<br />
Administrator &nbsp; &nbsp;QUARK\Admini... 512 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; S-1-5-21-139... QUARK<br />
Jeff &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QUARK\Jeff &nbsp; &nbsp; &nbsp;512 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; S-1-5-21-139... QUARK</div></div>
<p>These objects have some slightly different property names so to tweak the output I had to make a few changes.  Here&#8217;s my complete demo script.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;">#requires -version 3.0</span><br />
<br />
<span style="color: #008000;">#use CIM to list members of the local admin group</span><br />
<br />
<span style="color: #000000;">&#91;</span>cmdletbinding<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #0000FF;">Param</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$computer</span><span style="color: pink;">=</span><span style="color: #800080;">$env</span>:computername<span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800080;">$query</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;Associators of {Win32_Group.Domain='$computer',Name='Administrators'} where Role=GroupComponent&quot;</span><br />
<br />
<span style="color: #008080; font-weight: bold;">write-verbose</span> <span style="color: #800000;">&quot;Querying $computer&quot;</span><br />
<span style="color: #008080; font-weight: bold;">write-verbose</span> <span style="color: #800080;">$query</span> <br />
<br />
Get<span style="color: pink;">-</span>CIMInstance <span style="color: #008080; font-style: italic;">-query</span> <span style="color: #800080;">$query</span> <span style="color: pink;">-</span>computer <span style="color: #800080;">$computer</span> <span style="color: pink;">|</span> <br />
<span style="color: #008080; font-weight: bold;">Select</span> <span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>Name<span style="color: pink;">=</span><span style="color: #800000;">&quot;Member&quot;</span>;Expression<span style="color: pink;">=</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.Caption<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: pink;">,</span>Disabled<span style="color: pink;">,</span>LocalAccount<span style="color: pink;">,</span><br />
<span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>Name<span style="color: pink;">=</span><span style="color: #800000;">&quot;Type&quot;</span>;Expression<span style="color: pink;">=</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">regex</span><span style="color: #000000;">&#93;</span><span style="color: #800000;">&quot;User|Group&quot;</span><span style="color: #000000;">&#41;</span>.matches<span style="color: #000000;">&#40;</span><span style="color: #000080;">$_</span>.Class<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">0</span><span style="color: #000000;">&#93;</span>.Value<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: pink;">,</span><br />
<span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>Name<span style="color: pink;">=</span><span style="color: #800000;">&quot;Computername&quot;</span>;Expression<span style="color: pink;">=</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.ComputerName.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span></div></div>
<p>Here&#8217;s the code in action.</p>
<div class="codecolorer-container dos geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PS C:\<span style="color: #33cc33;">&gt;</span> C:\scripts\Get-CIMLocalAdmin.ps1 -Verbose<br />
VERBOSE: Querying QUARK<br />
VERBOSE: Associators of {Win32_Group.Domain='QUARK',Name='Administrators'}<br />
where Role=GroupComponent<br />
VERBOSE: Perform operation 'Query CimInstances' with following parameters,<br />
''namespaceName' = root\cimv2,'queryExpression' = Associators of<br />
{Win32_Group.Domain='QUARK',Name='Administrators'} where<br />
Role=GroupComponent,'queryDialect' = WQL'.<br />
<br />
<br />
Member &nbsp; &nbsp; &nbsp; : <span style="color: #b100b1; font-weight: bold;">QUARK\Administrator</span><br />
Disabled &nbsp; &nbsp; : <span style="color: #b100b1; font-weight: bold;">False</span><br />
LocalAccount : <span style="color: #b100b1; font-weight: bold;">True</span><br />
Type &nbsp; &nbsp; &nbsp; &nbsp; : <span style="color: #b100b1; font-weight: bold;">User</span><br />
Computername : <span style="color: #b100b1; font-weight: bold;">QUARK</span><br />
<br />
Member &nbsp; &nbsp; &nbsp; : <span style="color: #b100b1; font-weight: bold;">QUARK\Jeff</span><br />
Disabled &nbsp; &nbsp; : <span style="color: #b100b1; font-weight: bold;">False</span><br />
LocalAccount : <span style="color: #b100b1; font-weight: bold;">True</span><br />
Type &nbsp; &nbsp; &nbsp; &nbsp; : <span style="color: #b100b1; font-weight: bold;">User</span><br />
Computername : <span style="color: #b100b1; font-weight: bold;">QUARK</span></div></div>
<p>It wouldn&#8217;t be much to turn this into a function, although all computers will need to be running Powershell 3.0. Download <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L0dldC1DSU1Mb2NhbEFkbWluLnR4dA==" target='_blank'>Get-CIMLocalAdmin</a> and try it out for yourself.</p>
<p>Disclaimer: All of this is based on pre-released software. No guarantees that it will work when PowerShell 3.0 officially ships.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL2ludGVudC90d2VldD90ZXh0PVF1ZXJ5K0xvY2FsK0FkbWluaXN0cmF0b3JzK3dpdGgrQ0lNK2h0dHAlM0ElMkYlMkZqZGhpdHNvbHV0aW9ucy5jb20lMkZibG9nJTJGMjAxMiUyRjA1JTJGcXVlcnktbG9jYWwtYWRtaW5pc3RyYXRvcnMtd2l0aC1jaW0lMkY=" title=\"Post to Twitter\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter6.png" alt="Post to Twitter" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BsdXJrLmNvbS8/c3RhdHVzPSU1QkJMQU5LJTVE" title=\"Post to Plurk\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/plurk/tt-plurk.png" alt="Post to Plurk" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2J1enoueWFob28uY29tL2J1eno/dGFyZ2V0VXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3F1ZXJ5LWxvY2FsLWFkbWluaXN0cmF0b3JzLXdpdGgtY2ltLyZhbXA7aGVhZGxpbmU9UXVlcnkrTG9jYWwrQWRtaW5pc3RyYXRvcnMrd2l0aCtDSU0=" title=\"Post to Yahoo Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/buzz/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RlbGljaW91cy5jb20vcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVlcnktbG9jYWwtYWRtaW5pc3RyYXRvcnMtd2l0aC1jaW0vJmFtcDt0aXRsZT1RdWVyeStMb2NhbCtBZG1pbmlzdHJhdG9ycyt3aXRoK0NJTQ==" title=\"Post to Delicious\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RpZ2cuY29tL3N1Ym1pdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVlcnktbG9jYWwtYWRtaW5pc3RyYXRvcnMtd2l0aC1jaW0vJmFtcDt0aXRsZT1RdWVyeStMb2NhbCtBZG1pbmlzdHJhdG9ycyt3aXRoK0NJTQ==" title=\"Post to Digg\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="Post to Digg" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mYWNlYm9vay5jb20vc2hhcmUucGhwP3U9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVlcnktbG9jYWwtYWRtaW5pc3RyYXRvcnMtd2l0aC1jaW0vJmFtcDt0PVF1ZXJ5K0xvY2FsK0FkbWluaXN0cmF0b3JzK3dpdGgrQ0lN" title=\"Post to Facebook\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mcmllbmRmZWVkLmNvbS9zaGFyZT90aXRsZT1RdWVyeStMb2NhbCtBZG1pbmlzdHJhdG9ycyt3aXRoK0NJTSZhbXA7bGluaz1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9xdWVyeS1sb2NhbC1hZG1pbmlzdHJhdG9ycy13aXRoLWNpbS8=" title=\"Post to FriendFeed\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ff/tt-ff.png" alt="Post to FriendFeed" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL2J1enovcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVlcnktbG9jYWwtYWRtaW5pc3RyYXRvcnMtd2l0aC1jaW0vJmFtcDtpbWFnZXVybD0=" title=\"Post to Google Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/gbuzz/tt-gbuzz.png" alt="Post to Google Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BpbmcuZm0vcmVmLz9tZXRob2Q9bWljcm9ibG9nJmFtcDt0aXRsZT1RdWVyeStMb2NhbCtBZG1pbmlzdHJhdG9ycyt3aXRoK0NJTSZhbXA7bGluaz1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9xdWVyeS1sb2NhbC1hZG1pbmlzdHJhdG9ycy13aXRoLWNpbS8=" title=\"Post to Ping.fm\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ping/tt-ping.png" alt="Post to Ping.fm" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JlZGRpdC5jb20vc3VibWl0P3VybD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9xdWVyeS1sb2NhbC1hZG1pbmlzdHJhdG9ycy13aXRoLWNpbS8mYW1wO3RpdGxlPVF1ZXJ5K0xvY2FsK0FkbWluaXN0cmF0b3JzK3dpdGgrQ0lN" title=\"Post to Reddit\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NsYXNoZG90Lm9yZy9ib29rbWFyay5wbD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVlcnktbG9jYWwtYWRtaW5pc3RyYXRvcnMtd2l0aC1jaW0vJmFtcDt0aXRsZT1RdWVyeStMb2NhbCtBZG1pbmlzdHJhdG9ycyt3aXRoK0NJTQ==" title=\"Post to Slashdot\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/slashdot/tt-slashdot.png" alt="Post to Slashdot" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dW1ibGV1cG9uLmNvbS9zdWJtaXQ/dXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3F1ZXJ5LWxvY2FsLWFkbWluaXN0cmF0b3JzLXdpdGgtY2ltLyZhbXA7dGl0bGU9UXVlcnkrTG9jYWwrQWRtaW5pc3RyYXRvcnMrd2l0aCtDSU0=" title=\"Post to StumbleUpon\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL2ZhdmVzP2FkZD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9xdWVyeS1sb2NhbC1hZG1pbmlzdHJhdG9ycy13aXRoLWNpbS8=" title=\"Post to Technorati\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/technorati/tt-technorati.png" alt="Post to Technorati" /></a></p></div> <img src="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2342" width="1" height="1" style="display: none;" />
<p><a href="http://feedads.g.doubleclick.net/~a/KvPcvbNdpLljmm2M19x7mCym5Iw/0/da"><img src="http://feedads.g.doubleclick.net/~a/KvPcvbNdpLljmm2M19x7mCym5Iw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/KvPcvbNdpLljmm2M19x7mCym5Iw/1/da"><img src="http://feedads.g.doubleclick.net/~a/KvPcvbNdpLljmm2M19x7mCym5Iw/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/2JooSWs2_ZY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jdhitsolutions.com/blog/2012/05/query-local-administrators-with-cim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jdhitsolutions.com/blog/2012/05/query-local-administrators-with-cim/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=query-local-administrators-with-cim</feedburner:origLink></item>
		<item>
		<title>Query Local Administrators with WMI</title>
		<link>http://feedproxy.google.com/~r/JeffsScriptingBlogAndMore/~3/5K4cR5T7xkM/</link>
		<comments>http://jdhitsolutions.com/blog/2012/05/query-local-administrators-with-wmi/#comments</comments>
		<pubDate>Wed, 23 May 2012 14:09:54 +0000</pubDate>
		<dc:creator>Jeffery Hicks</dc:creator>
				<category><![CDATA[WMI]]></category>
		<category><![CDATA[Administrators]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://jdhitsolutions.com/blog/?p=2338</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
I have a quick post today on using WMI to list members of the local administrators group. It is very simple to get the group itself with the Win32_Group class. PS S:\&#62; get-wmiobject win32_group -filter &#34;name='Administrators'&#34; Caption &#160; &#160; &#160; &#8230; <a href="http://jdhitsolutions.com/blog/2012/05/query-local-administrators-with-wmi/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p>I have a quick post today on using WMI to list members of the local administrators group. It is very simple to get the group itself with the Win32_Group class.</p>
<div class="codecolorer-container dos geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PS S:\<span style="color: #33cc33;">&gt;</span> get-wmiobject win32_group -filter &quot;name='Administrators'&quot;<br />
<br />
Caption &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Domain &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SID<br />
------- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ------ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;---- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;---<br />
SERENITY\Adminis... SERENITY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Administrators &nbsp; &nbsp; &nbsp;S-1-5-32-544</div></div>
<p>But the class doesn&#8217;t have any methods or properties for returning members. However, WMI does allow for this cool thing called &#8220;Associators Of&#8221;. Basically we ask WMI, &#8220;Find everything associated or related to this object&#8221;. One quick way to do this is with the GetRelated() method.</p>
<div class="codecolorer-container dos geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PS S:\<span style="color: #33cc33;">&gt;</span> $group=get-wmiobject win32_group -filter &quot;name='Administrators'&quot;<br />
PS S:\<span style="color: #33cc33;">&gt;</span> $group.GetRelated<span style="color: #33cc33;">()</span></div></div>
<p>By default this will probably return more information than what you need. However, if you know you want to limit results to a single class you can do something like this:</p>
<div class="codecolorer-container dos geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PS S:\<span style="color: #33cc33;">&gt;</span> $group=get-wmiobject win32_group -filter &quot;name='Administrators'&quot;<br />
PS S:\<span style="color: #33cc33;">&gt;</span> $group.GetRelated<span style="color: #33cc33;">(</span>&quot;win32_useraccount&quot;<span style="color: #33cc33;">)</span><br />
<br />
<br />
AccountType : <span style="color: #b100b1; font-weight: bold;">512</span><br />
Caption &nbsp; &nbsp; : <span style="color: #b100b1; font-weight: bold;">SERENITY\Administrator</span><br />
Domain &nbsp; &nbsp; &nbsp;: <span style="color: #b100b1; font-weight: bold;">SERENITY</span><br />
SID &nbsp; &nbsp; &nbsp; &nbsp; : <span style="color: #b100b1; font-weight: bold;">S-1-5-21-2858895768-3673612314-3109562570-500</span><br />
FullName &nbsp; &nbsp;:<br />
Name &nbsp; &nbsp; &nbsp; &nbsp;: <span style="color: #b100b1; font-weight: bold;">Administrator</span><br />
<br />
AccountType : <span style="color: #b100b1; font-weight: bold;">512</span><br />
Caption &nbsp; &nbsp; : <span style="color: #b100b1; font-weight: bold;">SERENITY\Jeff</span><br />
Domain &nbsp; &nbsp; &nbsp;: <span style="color: #b100b1; font-weight: bold;">SERENITY</span><br />
SID &nbsp; &nbsp; &nbsp; &nbsp; : <span style="color: #b100b1; font-weight: bold;">S-1-5-21-2858895768-3673612314-3109562570-1000</span><br />
FullName &nbsp; &nbsp;:<br />
Name &nbsp; &nbsp; &nbsp; &nbsp;: <span style="color: #b100b1; font-weight: bold;">Jeff</span><br />
<br />
AccountType : <span style="color: #b100b1; font-weight: bold;">512</span><br />
Caption &nbsp; &nbsp; : <span style="color: #b100b1; font-weight: bold;">SERENITY\Backup</span><br />
Domain &nbsp; &nbsp; &nbsp;: <span style="color: #b100b1; font-weight: bold;">SERENITY</span><br />
SID &nbsp; &nbsp; &nbsp; &nbsp; : <span style="color: #b100b1; font-weight: bold;">S-1-5-21-2858895768-3673612314-3109562570-1010</span><br />
FullName &nbsp; &nbsp;:<br />
Name &nbsp; &nbsp; &nbsp; &nbsp;: <span style="color: #b100b1; font-weight: bold;">Backup</span></div></div>
<p>That&#8217;s pretty easy and fast. Unfortunately in this scenario, the group might also have other groups as a member which is a different class and I couldn&#8217;t find a reasonable syntax with GetRelated() to handle multiple classes. So instead we&#8217;ll go back to native WMI approach and use an Associators Of query. </p>
<p>This type of query must be follow a specific format. The best way is to use WBEMTest to find your object, then click on the Assopciators button. Your query syntax will be in the top of the query dialog box. This default query will return everything, but you can add additional filtering. Check out <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbS9lbi11cy9saWJyYXJ5L3dpbmRvd3MvZGVza3RvcC9hYTM4NDc5Myh2PXZzLjg1KS5hc3B4" target=\"_blank\">http://msdn.microsoft.com/en-us/library/windows/desktop/aa384793(v=vs.85).aspx</a> to learn more. In this situation, this query will return both users and groups.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$query</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;Associators of {Win32_Group.Domain='$computer',Name='Administrators'} where Role=GroupComponent&quot;</span></div></div>
<p>Here&#8217;s one way I might use it:</p>
<div class="codecolorer-container dos geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PS S:\<span style="color: #33cc33;">&gt;</span> get-wmiobject -query $query -ComputerName $computer <span style="color: #33cc33;">|</span> Select Name,Caption,__CLASS<br />
<br />
Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Caption &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__CLASS<br />
---- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ------- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-------<br />
Administrator &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SERENITY\Administrator &nbsp; &nbsp; Win32_UserAccount<br />
Jeff &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SERENITY\Jeff &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Win32_UserAccount<br />
Backup &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SERENITY\Backup &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Win32_UserAccount<br />
Help Desk &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SERENITY\Help Desk &nbsp; &nbsp; &nbsp; &nbsp; Win32_Group</div></div>
<p>I might even refine it a bit:</p>
<div class="codecolorer-container dos geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PS S:\<span style="color: #33cc33;">&gt;</span> get-wmiobject -query $query -computer $computer <span style="color: #33cc33;">|</span><br />
<span style="color: #33cc33;">&gt;&gt;</span> Select <span style="color: #33cc33;">@</span>{Name=&quot;Members&quot;;Expression={$_.Caption}},<br />
<span style="color: #33cc33;">&gt;&gt;</span> <span style="color: #33cc33;">@</span>{Name=&quot;Type&quot;;Expression={<span style="color: #33cc33;">(</span>[regex]&quot;User<span style="color: #33cc33;">|</span>Group&quot;<span style="color: #33cc33;">)</span>.matches<span style="color: #33cc33;">(</span>$_.__CLASS<span style="color: #33cc33;">)</span>[0].Value}},<br />
<span style="color: #33cc33;">&gt;&gt;</span> <span style="color: #33cc33;">@</span>{Name=&quot;Computername&quot;;Expression={$_.__SERVER}}<br />
<span style="color: #33cc33;">&gt;&gt;</span><br />
<br />
Members &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Type &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Computername<br />
------- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;---- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ------------<br />
SERENITY\Administrator &nbsp; &nbsp; User &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SERENITY<br />
SERENITY\Jeff &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;User &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SERENITY<br />
SERENITY\Backup &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;User &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SERENITY<br />
SERENITY\Help Desk &nbsp; &nbsp; &nbsp; &nbsp; Group &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SERENITY</div></div>
<p>It doesn&#8217;t take much more effort to turn this into a function, but I&#8217;ll leave that fun to you.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL2ludGVudC90d2VldD90ZXh0PVF1ZXJ5K0xvY2FsK0FkbWluaXN0cmF0b3JzK3dpdGgrV01JK2h0dHAlM0ElMkYlMkZqZGhpdHNvbHV0aW9ucy5jb20lMkZibG9nJTJGMjAxMiUyRjA1JTJGcXVlcnktbG9jYWwtYWRtaW5pc3RyYXRvcnMtd2l0aC13bWklMkY=" title=\"Post to Twitter\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter6.png" alt="Post to Twitter" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BsdXJrLmNvbS8/c3RhdHVzPSU1QkJMQU5LJTVE" title=\"Post to Plurk\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/plurk/tt-plurk.png" alt="Post to Plurk" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2J1enoueWFob28uY29tL2J1eno/dGFyZ2V0VXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3F1ZXJ5LWxvY2FsLWFkbWluaXN0cmF0b3JzLXdpdGgtd21pLyZhbXA7aGVhZGxpbmU9UXVlcnkrTG9jYWwrQWRtaW5pc3RyYXRvcnMrd2l0aCtXTUk=" title=\"Post to Yahoo Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/buzz/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RlbGljaW91cy5jb20vcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVlcnktbG9jYWwtYWRtaW5pc3RyYXRvcnMtd2l0aC13bWkvJmFtcDt0aXRsZT1RdWVyeStMb2NhbCtBZG1pbmlzdHJhdG9ycyt3aXRoK1dNSQ==" title=\"Post to Delicious\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RpZ2cuY29tL3N1Ym1pdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVlcnktbG9jYWwtYWRtaW5pc3RyYXRvcnMtd2l0aC13bWkvJmFtcDt0aXRsZT1RdWVyeStMb2NhbCtBZG1pbmlzdHJhdG9ycyt3aXRoK1dNSQ==" title=\"Post to Digg\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="Post to Digg" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mYWNlYm9vay5jb20vc2hhcmUucGhwP3U9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVlcnktbG9jYWwtYWRtaW5pc3RyYXRvcnMtd2l0aC13bWkvJmFtcDt0PVF1ZXJ5K0xvY2FsK0FkbWluaXN0cmF0b3JzK3dpdGgrV01J" title=\"Post to Facebook\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mcmllbmRmZWVkLmNvbS9zaGFyZT90aXRsZT1RdWVyeStMb2NhbCtBZG1pbmlzdHJhdG9ycyt3aXRoK1dNSSZhbXA7bGluaz1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9xdWVyeS1sb2NhbC1hZG1pbmlzdHJhdG9ycy13aXRoLXdtaS8=" title=\"Post to FriendFeed\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ff/tt-ff.png" alt="Post to FriendFeed" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL2J1enovcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVlcnktbG9jYWwtYWRtaW5pc3RyYXRvcnMtd2l0aC13bWkvJmFtcDtpbWFnZXVybD0=" title=\"Post to Google Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/gbuzz/tt-gbuzz.png" alt="Post to Google Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BpbmcuZm0vcmVmLz9tZXRob2Q9bWljcm9ibG9nJmFtcDt0aXRsZT1RdWVyeStMb2NhbCtBZG1pbmlzdHJhdG9ycyt3aXRoK1dNSSZhbXA7bGluaz1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9xdWVyeS1sb2NhbC1hZG1pbmlzdHJhdG9ycy13aXRoLXdtaS8=" title=\"Post to Ping.fm\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ping/tt-ping.png" alt="Post to Ping.fm" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JlZGRpdC5jb20vc3VibWl0P3VybD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9xdWVyeS1sb2NhbC1hZG1pbmlzdHJhdG9ycy13aXRoLXdtaS8mYW1wO3RpdGxlPVF1ZXJ5K0xvY2FsK0FkbWluaXN0cmF0b3JzK3dpdGgrV01J" title=\"Post to Reddit\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NsYXNoZG90Lm9yZy9ib29rbWFyay5wbD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVlcnktbG9jYWwtYWRtaW5pc3RyYXRvcnMtd2l0aC13bWkvJmFtcDt0aXRsZT1RdWVyeStMb2NhbCtBZG1pbmlzdHJhdG9ycyt3aXRoK1dNSQ==" title=\"Post to Slashdot\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/slashdot/tt-slashdot.png" alt="Post to Slashdot" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dW1ibGV1cG9uLmNvbS9zdWJtaXQ/dXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3F1ZXJ5LWxvY2FsLWFkbWluaXN0cmF0b3JzLXdpdGgtd21pLyZhbXA7dGl0bGU9UXVlcnkrTG9jYWwrQWRtaW5pc3RyYXRvcnMrd2l0aCtXTUk=" title=\"Post to StumbleUpon\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL2ZhdmVzP2FkZD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9xdWVyeS1sb2NhbC1hZG1pbmlzdHJhdG9ycy13aXRoLXdtaS8=" title=\"Post to Technorati\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/technorati/tt-technorati.png" alt="Post to Technorati" /></a></p></div> <img src="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2338" width="1" height="1" style="display: none;" />
<p><a href="http://feedads.g.doubleclick.net/~a/flrO-KWIPXBogPa5PZn0tWdbsRQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/flrO-KWIPXBogPa5PZn0tWdbsRQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/flrO-KWIPXBogPa5PZn0tWdbsRQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/flrO-KWIPXBogPa5PZn0tWdbsRQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/5K4cR5T7xkM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jdhitsolutions.com/blog/2012/05/query-local-administrators-with-wmi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jdhitsolutions.com/blog/2012/05/query-local-administrators-with-wmi/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=query-local-administrators-with-wmi</feedburner:origLink></item>
		<item>
		<title>Friday Fun: Get Latest PowerShell Scripts</title>
		<link>http://feedproxy.google.com/~r/JeffsScriptingBlogAndMore/~3/rSLZiujB0jw/</link>
		<comments>http://jdhitsolutions.com/blog/2012/05/friday-fun-get-latest-powershell-scripts/#comments</comments>
		<pubDate>Fri, 18 May 2012 14:51:12 +0000</pubDate>
		<dc:creator>Jeffery Hicks</dc:creator>
				<category><![CDATA[Friday Fun]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Measure-Object]]></category>
		<category><![CDATA[Out-Gridview]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://jdhitsolutions.com/blog/?p=2330</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
Probably like many of you I keep almost all of my scripts in a single location. I&#8217;m also usually working on multiple items at the same time. Some times I have difficult remembering the name of a script I might &#8230; <a href="http://jdhitsolutions.com/blog/2012/05/friday-fun-get-latest-powershell-scripts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p>Probably like many of you I keep almost all of my scripts in a single location. I&#8217;m also usually working on multiple items at the same time. Some times I have difficult remembering the name of a script I might have been working on a few days ago that I need to return to. The concept is simple enough: search my script directory for PowerShell files sorted by the last write time and look for the file I need.</p>
<p>That&#8217;s a lot to type so why not build a function to do the work for me? In fact, since I spend a lot of time in the PowerShell ISE, why not produce graphical output? The easiest way is to pipe results to Out-Gridview. So after a little tinkering, I came up with Get-LatestScript.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">Function</span> Get<span style="color: pink;">-</span>LatestScript <span style="color: #000000;">&#123;</span><br />
<br />
<span style="color: #000000;">&#91;</span>cmdletbinding<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
<br />
<span style="color: #0000FF;">Param</span><span style="color: #000000;">&#40;</span><br />
<span style="color: #000000;">&#91;</span>Parameter<span style="color: #000000;">&#40;</span>Position<span style="color: pink;">=</span><span style="color: #804000;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #000000;">&#91;</span>ValidateScript<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #008080; font-weight: bold;">Test-Path</span> <span style="color: #000080;">$_</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$Path</span><span style="color: pink;">=</span><span style="color: #800080;">$global</span>:ScriptPath<span style="color: pink;">,</span><br />
<span style="color: #000000;">&#91;</span>Parameter<span style="color: #000000;">&#40;</span>Position<span style="color: pink;">=</span><span style="color: #804000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #000000;">&#91;</span>ValidateScript<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span> <span style="color: #FF0000;">-ge</span> <span style="color: #804000;">1</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">int</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$Newest</span><span style="color: pink;">=</span><span style="color: #804000;">10</span><br />
<span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">-Not</span> <span style="color: #800080;">$path</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$Path</span><span style="color: pink;">=</span><span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">Get-Location</span><span style="color: #000000;">&#41;</span>.Path<br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #008000;">#define a list of file extensions</span><br />
<span style="color: #800080;">$include</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;*.ps1&quot;</span><span style="color: pink;">,</span><span style="color: #800000;">&quot;*.psd1&quot;</span><span style="color: pink;">,</span><span style="color: #800000;">&quot;*.psm1&quot;</span><span style="color: pink;">,</span><span style="color: #800000;">&quot;*.ps1xml&quot;</span><br />
<br />
<span style="color: #008080; font-weight: bold;">Write-Verbose</span> <span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Getting {0} PowerShell files from {1}&quot;</span> <span style="color: #FF0000;">-f</span> <span style="color: #800080;">$newest</span><span style="color: pink;">,</span><span style="color: #800080;">$path</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #008000;">#construct a title for Out-GridView</span><br />
<span style="color: #800080;">$Title</span><span style="color: pink;">=</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Recent PowerShell Files in {0}&quot;</span> <span style="color: #FF0000;">-f</span> <span style="color: #800080;">$path</span>.ToUpper<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #008080; font-weight: bold;">Get-ChildItem</span> <span style="color: #008080; font-style: italic;">-Path</span> <span style="color: #800080;">$Path</span> <span style="color: #008080; font-style: italic;">-Include</span> <span style="color: #800080;">$include</span> <span style="color: #008080; font-style: italic;">-Recurse</span> <span style="color: pink;">|</span> <br />
<span style="color: #008080; font-weight: bold;">Sort-Object</span> <span style="color: #008080; font-style: italic;">-Property</span> lastWriteTime <span style="color: #008080; font-style: italic;">-Descending</span> <span style="color: pink;">|</span><br />
<span style="color: #008080; font-weight: bold;">Select-Object</span> <span style="color: #008080; font-style: italic;">-First</span> <span style="color: #800080;">$newest</span> <span style="color: #008080; font-style: italic;">-Property</span> LastWriteTime<span style="color: pink;">,</span>CreationTime<span style="color: pink;">,</span><br />
<span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>Name<span style="color: pink;">=</span><span style="color: #800000;">&quot;Size&quot;</span>;Expression<span style="color: pink;">=</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.length<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: pink;">,</span><br />
<span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>Name<span style="color: pink;">=</span><span style="color: #800000;">&quot;Lines&quot;</span>;Expression<span style="color: pink;">=</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">Get-Content</span> <span style="color: #000080;">$_</span>.Fullname <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Measure-object</span> <span style="color: #008080; font-style: italic;">-line</span><span style="color: #000000;">&#41;</span>.Lines<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: pink;">,</span><br />
Directory<span style="color: pink;">,</span>Name<span style="color: pink;">,</span>FullName <span style="color: pink;">|</span> <br />
Out<span style="color: pink;">-</span>Gridview <span style="color: #008080; font-style: italic;">-Title</span> <span style="color: #800080;">$Title</span><br />
<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>I decided to try something different with the Path variable. I set the default to a global variable, ScriptPath. The idea is that in your PowerShell profile, you&#8217;ll have a line like this:</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$ScriptPath</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;C:\Scripts&quot;</span></div></div>
<p>If the function finds this variable, it will use it. Otherwise it will use the current location. Notice I&#8217;m also using a validation attribute to verify the path. By default the function returns the 10 newest PowerShell files, based on the last write time. The number of files can be controlled by the -Newest parameter.</p>
<p>In the heart of the script is a one-line expression to find all matching files in the script folder and subfolders.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-weight: bold;">Get-ChildItem</span> <span style="color: #008080; font-style: italic;">-Path</span> <span style="color: #800080;">$Path</span> <span style="color: #008080; font-style: italic;">-Include</span> <span style="color: #800080;">$include</span> <span style="color: #008080; font-style: italic;">-Recurse</span> <span style="color: pink;">|</span> <br />
<span style="color: #008080; font-weight: bold;">Sort-Object</span> <span style="color: #008080; font-style: italic;">-Property</span> lastWriteTime <span style="color: #008080; font-style: italic;">-Descending</span></div></div>
<p>These files are then sorted on the LastWriteTime in descending order and then I only select the first $newest number of files.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Sort-Object</span> <span style="color: #008080; font-style: italic;">-Property</span> lastWriteTime <span style="color: #008080; font-style: italic;">-Descending</span> <span style="color: pink;">|</span><br />
<span style="color: #008080; font-weight: bold;">Select-Object</span> <span style="color: #008080; font-style: italic;">-First</span> <span style="color: #800080;">$newest</span> ...</div></div>
<p>I am only interested in a few file properties so I select them. I also add a custom property to measure the file and get the number of lines in the script.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">...<span style="color: #008080; font-style: italic;">-Property</span> LastWriteTime<span style="color: pink;">,</span>CreationTime<span style="color: pink;">,</span><br />
<span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>Name<span style="color: pink;">=</span><span style="color: #800000;">&quot;Size&quot;</span>;Expression<span style="color: pink;">=</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.length<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: pink;">,</span><br />
<span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>Name<span style="color: pink;">=</span><span style="color: #800000;">&quot;Lines&quot;</span>;Expression<span style="color: pink;">=</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">Get-Content</span> <span style="color: #000080;">$_</span>.Fullname <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Measure-object</span> <span style="color: #008080; font-style: italic;">-line</span><span style="color: #000000;">&#41;</span>.Lines<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: pink;">,</span><br />
Directory<span style="color: pink;">,</span>Name<span style="color: pink;">,</span>FullName</div></div>
<p>Finally the results are piped to Out-Gridview.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">... <span style="color: pink;">|</span> Out<span style="color: pink;">-</span>Gridview <span style="color: #008080; font-style: italic;">-Title</span> $Title</div></div>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L2dldC1sYXRlc3RzY3JpcHQucG5nI3V0bV9zb3VyY2U9ZmVlZCZhbXA7dXRtX21lZGl1bT1mZWVkJmFtcDt1dG1fY2FtcGFpZ249ZmVlZA=="><img src="http://jdhitsolutions.com/blog/wp-content/uploads/2012/05/get-latestscript-300x133.png" alt="" title="get-latestscript" width="300" height="133" class="aligncenter size-medium wp-image-2331" /></a></p>
<p>For now, I have to manually open the file. Perhaps I&#8217;ll create a WinForm or use ShowUI to integrate it into the PowerShell ISE.</p>
<p>You can download <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L0dldC1MYXRlc3RTY3JpcHQudHh0" target='_blank'>Get-LatestScript</a> which includes comment based help.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL2ludGVudC90d2VldD90ZXh0PUZyaWRheStGdW4lM0ErR2V0K0xhdGVzdCtQb3dlclNoZWxsK1NjcmlwdHMraHR0cCUzQSUyRiUyRmpkaGl0c29sdXRpb25zLmNvbSUyRmJsb2clMkYyMDEyJTJGMDUlMkZmcmlkYXktZnVuLWdldC1sYXRlc3QtcG93ZXJzaGVsbC1zY3JpcHRzJTJG" title=\"Post to Twitter\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter6.png" alt="Post to Twitter" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BsdXJrLmNvbS8/c3RhdHVzPSU1QkJMQU5LJTVE" title=\"Post to Plurk\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/plurk/tt-plurk.png" alt="Post to Plurk" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2J1enoueWFob28uY29tL2J1eno/dGFyZ2V0VXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L2ZyaWRheS1mdW4tZ2V0LWxhdGVzdC1wb3dlcnNoZWxsLXNjcmlwdHMvJmFtcDtoZWFkbGluZT1GcmlkYXkrRnVuJTNBK0dldCtMYXRlc3QrUG93ZXJTaGVsbCtTY3JpcHRz" title=\"Post to Yahoo Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/buzz/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RlbGljaW91cy5jb20vcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZnJpZGF5LWZ1bi1nZXQtbGF0ZXN0LXBvd2Vyc2hlbGwtc2NyaXB0cy8mYW1wO3RpdGxlPUZyaWRheStGdW4lM0ErR2V0K0xhdGVzdCtQb3dlclNoZWxsK1NjcmlwdHM=" title=\"Post to Delicious\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RpZ2cuY29tL3N1Ym1pdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZnJpZGF5LWZ1bi1nZXQtbGF0ZXN0LXBvd2Vyc2hlbGwtc2NyaXB0cy8mYW1wO3RpdGxlPUZyaWRheStGdW4lM0ErR2V0K0xhdGVzdCtQb3dlclNoZWxsK1NjcmlwdHM=" title=\"Post to Digg\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="Post to Digg" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mYWNlYm9vay5jb20vc2hhcmUucGhwP3U9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZnJpZGF5LWZ1bi1nZXQtbGF0ZXN0LXBvd2Vyc2hlbGwtc2NyaXB0cy8mYW1wO3Q9RnJpZGF5K0Z1biUzQStHZXQrTGF0ZXN0K1Bvd2VyU2hlbGwrU2NyaXB0cw==" title=\"Post to Facebook\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mcmllbmRmZWVkLmNvbS9zaGFyZT90aXRsZT1GcmlkYXkrRnVuJTNBK0dldCtMYXRlc3QrUG93ZXJTaGVsbCtTY3JpcHRzJmFtcDtsaW5rPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L2ZyaWRheS1mdW4tZ2V0LWxhdGVzdC1wb3dlcnNoZWxsLXNjcmlwdHMv" title=\"Post to FriendFeed\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ff/tt-ff.png" alt="Post to FriendFeed" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL2J1enovcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZnJpZGF5LWZ1bi1nZXQtbGF0ZXN0LXBvd2Vyc2hlbGwtc2NyaXB0cy8mYW1wO2ltYWdldXJsPQ==" title=\"Post to Google Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/gbuzz/tt-gbuzz.png" alt="Post to Google Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BpbmcuZm0vcmVmLz9tZXRob2Q9bWljcm9ibG9nJmFtcDt0aXRsZT1GcmlkYXkrRnVuJTNBK0dldCtMYXRlc3QrUG93ZXJTaGVsbCtTY3JpcHRzJmFtcDtsaW5rPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L2ZyaWRheS1mdW4tZ2V0LWxhdGVzdC1wb3dlcnNoZWxsLXNjcmlwdHMv" title=\"Post to Ping.fm\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ping/tt-ping.png" alt="Post to Ping.fm" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JlZGRpdC5jb20vc3VibWl0P3VybD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9mcmlkYXktZnVuLWdldC1sYXRlc3QtcG93ZXJzaGVsbC1zY3JpcHRzLyZhbXA7dGl0bGU9RnJpZGF5K0Z1biUzQStHZXQrTGF0ZXN0K1Bvd2VyU2hlbGwrU2NyaXB0cw==" title=\"Post to Reddit\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NsYXNoZG90Lm9yZy9ib29rbWFyay5wbD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZnJpZGF5LWZ1bi1nZXQtbGF0ZXN0LXBvd2Vyc2hlbGwtc2NyaXB0cy8mYW1wO3RpdGxlPUZyaWRheStGdW4lM0ErR2V0K0xhdGVzdCtQb3dlclNoZWxsK1NjcmlwdHM=" title=\"Post to Slashdot\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/slashdot/tt-slashdot.png" alt="Post to Slashdot" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dW1ibGV1cG9uLmNvbS9zdWJtaXQ/dXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L2ZyaWRheS1mdW4tZ2V0LWxhdGVzdC1wb3dlcnNoZWxsLXNjcmlwdHMvJmFtcDt0aXRsZT1GcmlkYXkrRnVuJTNBK0dldCtMYXRlc3QrUG93ZXJTaGVsbCtTY3JpcHRz" title=\"Post to StumbleUpon\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL2ZhdmVzP2FkZD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9mcmlkYXktZnVuLWdldC1sYXRlc3QtcG93ZXJzaGVsbC1zY3JpcHRzLw==" title=\"Post to Technorati\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/technorati/tt-technorati.png" alt="Post to Technorati" /></a></p></div> <img src="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2330" width="1" height="1" style="display: none;" />
<p><a href="http://feedads.g.doubleclick.net/~a/VY38cMN8zmcOI8Wthsz3fOEO7MU/0/da"><img src="http://feedads.g.doubleclick.net/~a/VY38cMN8zmcOI8Wthsz3fOEO7MU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/VY38cMN8zmcOI8Wthsz3fOEO7MU/1/da"><img src="http://feedads.g.doubleclick.net/~a/VY38cMN8zmcOI8Wthsz3fOEO7MU/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/rSLZiujB0jw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jdhitsolutions.com/blog/2012/05/friday-fun-get-latest-powershell-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jdhitsolutions.com/blog/2012/05/friday-fun-get-latest-powershell-scripts/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=friday-fun-get-latest-powershell-scripts</feedburner:origLink></item>
		<item>
		<title>Introducing the ScriptingHelp PowerShell Module</title>
		<link>http://feedproxy.google.com/~r/JeffsScriptingBlogAndMore/~3/DXIOARGuB_o/</link>
		<comments>http://jdhitsolutions.com/blog/2012/05/introducing-the-scriptinghelp-powershell-module/#comments</comments>
		<pubDate>Wed, 16 May 2012 13:47:58 +0000</pubDate>
		<dc:creator>Jeffery Hicks</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PowerShell v2.0]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[ScriptingHelp]]></category>

		<guid isPermaLink="false">http://jdhitsolutions.com/blog/?p=2318</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
Over the last few weeks I&#8217;ve posted articles on the different parameter validation options in Windows PowerShell. More than one person suggested consolidating the articles. That seemed like a good idea. There were a variety of ways to handle this &#8230; <a href="http://jdhitsolutions.com/blog/2012/05/introducing-the-scriptinghelp-powershell-module/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDExLzAzL2hlbHBidWJibGUucG5nI3V0bV9zb3VyY2U9ZmVlZCZhbXA7dXRtX21lZGl1bT1mZWVkJmFtcDt1dG1fY2FtcGFpZ249ZmVlZA=="><img src="http://jdhitsolutions.com/blog/wp-content/uploads/2011/03/helpbubble.png" alt="" title="helpbubble" width="180" height="180" class="alignleft size-full wp-image-1294" /></a>Over the last few weeks I&#8217;ve posted articles on the different parameter validation options in Windows PowerShell. More than one person suggested consolidating the articles. That seemed like a good idea. There were a variety of ways to handle this but I wanted something more PowerShell-oriented. Then I realized, why not produce PowerShell About topics? I could create a module that primarily was a collection of about topics on scripting in PowerShell. Import the module and you get the documentation. </p>
<p>In fact, this is a slick idea you might want to take advantage of: create a PowerShell module with nothing but documentation delivered via About_* files. If you are spending a lot of time in the shell, stay there! But before I get sidetracked, let&#8217;s look at the module I&#8217;m calling ScriptingHelp.</p>
<p>As I said the module is mostly a collection of About_* topics based on some of my blog articles. Then I realized I wanted to make it easier to expose them so I threw together a brief function called Get-ScriptingHelp.</p>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L2dldC1zY3JpcHRpbmdoZWxwLnBuZyN1dG1fc291cmNlPWZlZWQmYW1wO3V0bV9tZWRpdW09ZmVlZCZhbXA7dXRtX2NhbXBhaWduPWZlZWQ="><img src="http://jdhitsolutions.com/blog/wp-content/uploads/2012/05/get-scriptinghelp-300x185.png" alt="" title="get-scriptinghelp" width="300" height="185" class="aligncenter size-medium wp-image-2320" /></a></p>
<p>The About topics are edited and revised versions of material previously posted on my blog.</p>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L3NjcmlwdGluZ2hlbHAtdmFsaWRhdGVzZXQucG5nI3V0bV9zb3VyY2U9ZmVlZCZhbXA7dXRtX21lZGl1bT1mZWVkJmFtcDt1dG1fY2FtcGFpZ249ZmVlZA=="><img src="http://jdhitsolutions.com/blog/wp-content/uploads/2012/05/scriptinghelp-validateset-300x185.png" alt="" title="scriptinghelp-validateset" width="300" height="185" class="aligncenter size-medium wp-image-2321" /></a></p>
<p>I plan on contributing additional content over time based on previous blog articles, suggestions or anything that comes to mind that I think can help you write more effective PowerShell scripts and functions.</p>
<p>To that end, I have also included a function to help you start scripting even faster. It is a new function wizard called Invoke-FunctionWizard. When you run the wizard, you will be prompted for information about your new function such as its name and parameter information. The wizard will then write a string object with the skeletal outline of your new function, complete with comment-based help. If you run the wizard in the ISE it will automatically insert the text into the currently open file. </p>
<p>But perhaps you&#8217;d like to see all of this in action.</p>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/a_6QXihUS0c" frameborder="0" allowfullscreen></iframe></p>
<p>I hope you&#8217;ll let me know what you think and if you find this useful or worthy of continued development. You can download a zip file of <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L1NjcmlwdGluZ0hlbHBfMF85LnppcA==">ScriptingHelp_0_9</a>. Extract the folder as a subfolder under C:\Users\<you>\Documents\WindowsPowerShell\Modules. Then import the ScriptingHelp module. This should work in both the console and the PowerShell ISE.  Enjoy!</p>
<div class="tweetthis" style="text-align:left;"><p> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL2ludGVudC90d2VldD90ZXh0PUludHJvZHVjaW5nK3RoZStTY3JpcHRpbmdIZWxwK1Bvd2VyU2hlbGwrTW9kdWxlK2h0dHAlM0ElMkYlMkZqZGhpdHNvbHV0aW9ucy5jb20lMkZibG9nJTJGMjAxMiUyRjA1JTJGaW50cm9kdWNpbmctdGhlLXNjcmlwdGluZ2hlbHAtcG93ZXJzaGVsbC1tb2R1bGUlMkY=" title=\"Post to Twitter\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter6.png" alt="Post to Twitter" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BsdXJrLmNvbS8/c3RhdHVzPSU1QkJMQU5LJTVE" title=\"Post to Plurk\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/plurk/tt-plurk.png" alt="Post to Plurk" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2J1enoueWFob28uY29tL2J1eno/dGFyZ2V0VXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L2ludHJvZHVjaW5nLXRoZS1zY3JpcHRpbmdoZWxwLXBvd2Vyc2hlbGwtbW9kdWxlLyZhbXA7aGVhZGxpbmU9SW50cm9kdWNpbmcrdGhlK1NjcmlwdGluZ0hlbHArUG93ZXJTaGVsbCtNb2R1bGU=" title=\"Post to Yahoo Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/buzz/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RlbGljaW91cy5jb20vcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvaW50cm9kdWNpbmctdGhlLXNjcmlwdGluZ2hlbHAtcG93ZXJzaGVsbC1tb2R1bGUvJmFtcDt0aXRsZT1JbnRyb2R1Y2luZyt0aGUrU2NyaXB0aW5nSGVscCtQb3dlclNoZWxsK01vZHVsZQ==" title=\"Post to Delicious\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RpZ2cuY29tL3N1Ym1pdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvaW50cm9kdWNpbmctdGhlLXNjcmlwdGluZ2hlbHAtcG93ZXJzaGVsbC1tb2R1bGUvJmFtcDt0aXRsZT1JbnRyb2R1Y2luZyt0aGUrU2NyaXB0aW5nSGVscCtQb3dlclNoZWxsK01vZHVsZQ==" title=\"Post to Digg\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="Post to Digg" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mYWNlYm9vay5jb20vc2hhcmUucGhwP3U9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvaW50cm9kdWNpbmctdGhlLXNjcmlwdGluZ2hlbHAtcG93ZXJzaGVsbC1tb2R1bGUvJmFtcDt0PUludHJvZHVjaW5nK3RoZStTY3JpcHRpbmdIZWxwK1Bvd2VyU2hlbGwrTW9kdWxl" title=\"Post to Facebook\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mcmllbmRmZWVkLmNvbS9zaGFyZT90aXRsZT1JbnRyb2R1Y2luZyt0aGUrU2NyaXB0aW5nSGVscCtQb3dlclNoZWxsK01vZHVsZSZhbXA7bGluaz1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9pbnRyb2R1Y2luZy10aGUtc2NyaXB0aW5naGVscC1wb3dlcnNoZWxsLW1vZHVsZS8=" title=\"Post to FriendFeed\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ff/tt-ff.png" alt="Post to FriendFeed" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL2J1enovcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvaW50cm9kdWNpbmctdGhlLXNjcmlwdGluZ2hlbHAtcG93ZXJzaGVsbC1tb2R1bGUvJmFtcDtpbWFnZXVybD0=" title=\"Post to Google Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/gbuzz/tt-gbuzz.png" alt="Post to Google Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BpbmcuZm0vcmVmLz9tZXRob2Q9bWljcm9ibG9nJmFtcDt0aXRsZT1JbnRyb2R1Y2luZyt0aGUrU2NyaXB0aW5nSGVscCtQb3dlclNoZWxsK01vZHVsZSZhbXA7bGluaz1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9pbnRyb2R1Y2luZy10aGUtc2NyaXB0aW5naGVscC1wb3dlcnNoZWxsLW1vZHVsZS8=" title=\"Post to Ping.fm\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ping/tt-ping.png" alt="Post to Ping.fm" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JlZGRpdC5jb20vc3VibWl0P3VybD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9pbnRyb2R1Y2luZy10aGUtc2NyaXB0aW5naGVscC1wb3dlcnNoZWxsLW1vZHVsZS8mYW1wO3RpdGxlPUludHJvZHVjaW5nK3RoZStTY3JpcHRpbmdIZWxwK1Bvd2VyU2hlbGwrTW9kdWxl" title=\"Post to Reddit\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NsYXNoZG90Lm9yZy9ib29rbWFyay5wbD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvaW50cm9kdWNpbmctdGhlLXNjcmlwdGluZ2hlbHAtcG93ZXJzaGVsbC1tb2R1bGUvJmFtcDt0aXRsZT1JbnRyb2R1Y2luZyt0aGUrU2NyaXB0aW5nSGVscCtQb3dlclNoZWxsK01vZHVsZQ==" title=\"Post to Slashdot\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/slashdot/tt-slashdot.png" alt="Post to Slashdot" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dW1ibGV1cG9uLmNvbS9zdWJtaXQ/dXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L2ludHJvZHVjaW5nLXRoZS1zY3JpcHRpbmdoZWxwLXBvd2Vyc2hlbGwtbW9kdWxlLyZhbXA7dGl0bGU9SW50cm9kdWNpbmcrdGhlK1NjcmlwdGluZ0hlbHArUG93ZXJTaGVsbCtNb2R1bGU=" title=\"Post to StumbleUpon\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL2ZhdmVzP2FkZD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9pbnRyb2R1Y2luZy10aGUtc2NyaXB0aW5naGVscC1wb3dlcnNoZWxsLW1vZHVsZS8=" title=\"Post to Technorati\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/technorati/tt-technorati.png" alt="Post to Technorati" /></a></p></div> <img src="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2318" width="1" height="1" style="display: none;" />
<p><a href="http://feedads.g.doubleclick.net/~a/bPrwjGyer-2PR8V2WzZquvr2pjc/0/da"><img src="http://feedads.g.doubleclick.net/~a/bPrwjGyer-2PR8V2WzZquvr2pjc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/bPrwjGyer-2PR8V2WzZquvr2pjc/1/da"><img src="http://feedads.g.doubleclick.net/~a/bPrwjGyer-2PR8V2WzZquvr2pjc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/DXIOARGuB_o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jdhitsolutions.com/blog/2012/05/introducing-the-scriptinghelp-powershell-module/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://jdhitsolutions.com/blog/2012/05/introducing-the-scriptinghelp-powershell-module/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=introducing-the-scriptinghelp-powershell-module</feedburner:origLink></item>
		<item>
		<title>PowerShell Scripting with [ValidateNotNullorEmpty]</title>
		<link>http://feedproxy.google.com/~r/JeffsScriptingBlogAndMore/~3/RnseaRNYESk/</link>
		<comments>http://jdhitsolutions.com/blog/2012/05/powershell-scripting-with-validatenotnullorempty/#comments</comments>
		<pubDate>Tue, 15 May 2012 12:18:41 +0000</pubDate>
		<dc:creator>Jeffery Hicks</dc:creator>
				<category><![CDATA[PowerShell v2.0]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://jdhitsolutions.com/blog/?p=2306</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
I&#8217;ve been writing about the different parameter validation attributes that you can use in your PowerShell scripting. One that I use in practically every script is [ValidateNotNullorEmpty()]. This validation will ensure that something is passed as a parameter value. I&#8217;m &#8230; <a href="http://jdhitsolutions.com/blog/2012/05/powershell-scripting-with-validatenotnullorempty/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p>I&#8217;ve been writing about the different parameter validation attributes that you can use in your PowerShell scripting. One that I use in practically every script is [ValidateNotNullorEmpty()]. This validation will ensure that something is passed as a parameter value. I&#8217;m not talking about making a parameter mandatory; only that if the user decides to use the parameter that something is passed.  Let&#8217;s look at my demo.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;">#requires -version 2.0</span><br />
<br />
<span style="color: #0000FF;">Param</span> <span style="color: #000000;">&#40;</span><br />
<span style="color: #000000;">&#91;</span>Parameter<span style="color: #000000;">&#40;</span>Position<span style="color: pink;">=</span><span style="color: #804000;">0</span><span style="color: pink;">,</span>Mandatory<span style="color: pink;">=</span><span style="color: #800080;">$True</span><span style="color: pink;">,</span>HelpMessage<span style="color: pink;">=</span><span style="color: #800000;">&quot;Enter a process name like lsass&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #000000;">&#91;</span>ValidateNotNullorEmpty<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$Name</span><span style="color: pink;">,</span><br />
<span style="color: #000000;">&#91;</span>Parameter<span style="color: #000000;">&#40;</span>Position<span style="color: pink;">=</span><span style="color: #804000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #000000;">&#91;</span>ValidateNotNullorEmpty<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$Computername</span><span style="color: pink;">=</span><span style="color: #800080;">$env</span>:computername<br />
<br />
<span style="color: #000000;">&#41;</span><br />
<br />
Try <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Get-Process</span> <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800080;">$name</span> <span style="color: #008080; font-style: italic;">-ComputerName</span> <span style="color: #800080;">$computername</span> <span style="color: #008080; font-style: italic;">-errorAction</span> <span style="color: #800000;">&quot;Stop&quot;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Select</span> <span style="color: pink;">*,</span><br />
&nbsp; &nbsp; <span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>Name<span style="color: pink;">=</span><span style="color: #800000;">&quot;Runtime&quot;</span>;Expression<span style="color: pink;">=</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">Get-Date</span><span style="color: #000000;">&#41;</span><span style="color: pink;">-</span><span style="color: #000080;">$_</span>.StartTime<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span><br />
<br />
Catch <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Warning</span> <span style="color: #000080;">$_</span>.Exception.Message<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>I&#8217;ve used the attribute on both parameters. The first parameter I&#8217;ve also made mandatory which makes it more likely that something will be entered. But if not, then the script will fail.</p>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L3ZhbGlkYXRlbm90bnVsbG9yZW1wdHkucG5nI3V0bV9zb3VyY2U9ZmVlZCZhbXA7dXRtX21lZGl1bT1mZWVkJmFtcDt1dG1fY2FtcGFpZ249ZmVlZA=="><img src="http://jdhitsolutions.com/blog/wp-content/uploads/2012/05/validatenotnullorempty-300x141.png" alt="" title="validatenotnullorempty" width="300" height="141" class="aligncenter size-medium wp-image-2307" /></a></p>
<p>I would get a similar message if the user forgot to complete the command.</p>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L3ZhbGlkYXRlbm90bnVsbG9yZW1wdHktMi5wbmcjdXRtX3NvdXJjZT1mZWVkJmFtcDt1dG1fbWVkaXVtPWZlZWQmYW1wO3V0bV9jYW1wYWlnbj1mZWVk"><img src="http://jdhitsolutions.com/blog/wp-content/uploads/2012/05/validatenotnullorempty-2-300x91.png" alt="" title="validatenotnullorempty-2" width="300" height="91" class="aligncenter size-medium wp-image-2308" /></a></p>
<p>Even though I&#8217;m using a default value for Computername, as soon as the parameter is detected PowerShell assumes I&#8217;m going to use a different value.</p>
<p>Validation should work for missing values, a variable that might be null, or in general anything that is meaningless. However, it won&#8217;t prevent something quirky like this:</p>
<div class="codecolorer-container dos geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PS S:\<span style="color: #33cc33;">&gt;</span> $p=&quot; &quot;<br />
PS S:\<span style="color: #33cc33;">&gt;</span> .\demo-ValidateNotNull.ps1 -name $p<br />
WARNING: Cannot find a process with the name &quot; &quot;. <span style="color: #b1b100; font-weight: bold;">Verify</span> the process name and<br />
<span style="color: #00b100; font-weight: bold;">call</span> the cmdlet again.</div></div>
<p>The variable, while semantically meaningless to us, is not null or empty but a string of 1 space. If there&#8217;s the chance you might run into this situation then you can add additional validation checks to the parameter.</p>
<p>If you&#8217;d like, feel free to download <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L2RlbW8tVmFsaWRhdGVOb3ROdWxsLnR4dA==" target='_blank'>Demo-ValidateNotNull</a> and see for yourself.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL2ludGVudC90d2VldD90ZXh0PVBvd2VyU2hlbGwrU2NyaXB0aW5nK3dpdGgrJTVCVmFsaWRhdGVOb3ROdWxsb3JFbXB0eSU1RCtodHRwJTNBJTJGJTJGYml0Lmx5JTJGSmdwZkNF" title=\"Post to Twitter\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter6.png" alt="Post to Twitter" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BsdXJrLmNvbS8/c3RhdHVzPSU1QkJMQU5LJTVE" title=\"Post to Plurk\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/plurk/tt-plurk.png" alt="Post to Plurk" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2J1enoueWFob28uY29tL2J1eno/dGFyZ2V0VXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3Bvd2Vyc2hlbGwtc2NyaXB0aW5nLXdpdGgtdmFsaWRhdGVub3RudWxsb3JlbXB0eS8mYW1wO2hlYWRsaW5lPVBvd2VyU2hlbGwrU2NyaXB0aW5nK3dpdGgrJTVCVmFsaWRhdGVOb3ROdWxsb3JFbXB0eSU1RA==" title=\"Post to Yahoo Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/buzz/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RlbGljaW91cy5jb20vcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcG93ZXJzaGVsbC1zY3JpcHRpbmctd2l0aC12YWxpZGF0ZW5vdG51bGxvcmVtcHR5LyZhbXA7dGl0bGU9UG93ZXJTaGVsbCtTY3JpcHRpbmcrd2l0aCslNUJWYWxpZGF0ZU5vdE51bGxvckVtcHR5JTVE" title=\"Post to Delicious\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RpZ2cuY29tL3N1Ym1pdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcG93ZXJzaGVsbC1zY3JpcHRpbmctd2l0aC12YWxpZGF0ZW5vdG51bGxvcmVtcHR5LyZhbXA7dGl0bGU9UG93ZXJTaGVsbCtTY3JpcHRpbmcrd2l0aCslNUJWYWxpZGF0ZU5vdE51bGxvckVtcHR5JTVE" title=\"Post to Digg\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="Post to Digg" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mYWNlYm9vay5jb20vc2hhcmUucGhwP3U9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcG93ZXJzaGVsbC1zY3JpcHRpbmctd2l0aC12YWxpZGF0ZW5vdG51bGxvcmVtcHR5LyZhbXA7dD1Qb3dlclNoZWxsK1NjcmlwdGluZyt3aXRoKyU1QlZhbGlkYXRlTm90TnVsbG9yRW1wdHklNUQ=" title=\"Post to Facebook\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mcmllbmRmZWVkLmNvbS9zaGFyZT90aXRsZT1Qb3dlclNoZWxsK1NjcmlwdGluZyt3aXRoKyU1QlZhbGlkYXRlTm90TnVsbG9yRW1wdHklNUQmYW1wO2xpbms9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcG93ZXJzaGVsbC1zY3JpcHRpbmctd2l0aC12YWxpZGF0ZW5vdG51bGxvcmVtcHR5Lw==" title=\"Post to FriendFeed\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ff/tt-ff.png" alt="Post to FriendFeed" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL2J1enovcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcG93ZXJzaGVsbC1zY3JpcHRpbmctd2l0aC12YWxpZGF0ZW5vdG51bGxvcmVtcHR5LyZhbXA7aW1hZ2V1cmw9" title=\"Post to Google Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/gbuzz/tt-gbuzz.png" alt="Post to Google Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BpbmcuZm0vcmVmLz9tZXRob2Q9bWljcm9ibG9nJmFtcDt0aXRsZT1Qb3dlclNoZWxsK1NjcmlwdGluZyt3aXRoKyU1QlZhbGlkYXRlTm90TnVsbG9yRW1wdHklNUQmYW1wO2xpbms9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcG93ZXJzaGVsbC1zY3JpcHRpbmctd2l0aC12YWxpZGF0ZW5vdG51bGxvcmVtcHR5Lw==" title=\"Post to Ping.fm\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ping/tt-ping.png" alt="Post to Ping.fm" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JlZGRpdC5jb20vc3VibWl0P3VybD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9wb3dlcnNoZWxsLXNjcmlwdGluZy13aXRoLXZhbGlkYXRlbm90bnVsbG9yZW1wdHkvJmFtcDt0aXRsZT1Qb3dlclNoZWxsK1NjcmlwdGluZyt3aXRoKyU1QlZhbGlkYXRlTm90TnVsbG9yRW1wdHklNUQ=" title=\"Post to Reddit\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NsYXNoZG90Lm9yZy9ib29rbWFyay5wbD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcG93ZXJzaGVsbC1zY3JpcHRpbmctd2l0aC12YWxpZGF0ZW5vdG51bGxvcmVtcHR5LyZhbXA7dGl0bGU9UG93ZXJTaGVsbCtTY3JpcHRpbmcrd2l0aCslNUJWYWxpZGF0ZU5vdE51bGxvckVtcHR5JTVE" title=\"Post to Slashdot\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/slashdot/tt-slashdot.png" alt="Post to Slashdot" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dW1ibGV1cG9uLmNvbS9zdWJtaXQ/dXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3Bvd2Vyc2hlbGwtc2NyaXB0aW5nLXdpdGgtdmFsaWRhdGVub3RudWxsb3JlbXB0eS8mYW1wO3RpdGxlPVBvd2VyU2hlbGwrU2NyaXB0aW5nK3dpdGgrJTVCVmFsaWRhdGVOb3ROdWxsb3JFbXB0eSU1RA==" title=\"Post to StumbleUpon\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL2ZhdmVzP2FkZD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9wb3dlcnNoZWxsLXNjcmlwdGluZy13aXRoLXZhbGlkYXRlbm90bnVsbG9yZW1wdHkv" title=\"Post to Technorati\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/technorati/tt-technorati.png" alt="Post to Technorati" /></a></p></div> <img src="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2306" width="1" height="1" style="display: none;" />
<p><a href="http://feedads.g.doubleclick.net/~a/1TcAaFVy0OVe94Tfz-UBS1ofaJE/0/da"><img src="http://feedads.g.doubleclick.net/~a/1TcAaFVy0OVe94Tfz-UBS1ofaJE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/1TcAaFVy0OVe94Tfz-UBS1ofaJE/1/da"><img src="http://feedads.g.doubleclick.net/~a/1TcAaFVy0OVe94Tfz-UBS1ofaJE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/RnseaRNYESk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jdhitsolutions.com/blog/2012/05/powershell-scripting-with-validatenotnullorempty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jdhitsolutions.com/blog/2012/05/powershell-scripting-with-validatenotnullorempty/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=powershell-scripting-with-validatenotnullorempty</feedburner:origLink></item>
		<item>
		<title>SQL Saturday 129 Session Material</title>
		<link>http://feedproxy.google.com/~r/JeffsScriptingBlogAndMore/~3/v4vWNydTKrw/</link>
		<comments>http://jdhitsolutions.com/blog/2012/05/sql-saturday-129-session-material/#comments</comments>
		<pubDate>Mon, 14 May 2012 13:51:32 +0000</pubDate>
		<dc:creator>Jeffery Hicks</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Powershell 3.0]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[scheduled job]]></category>
		<category><![CDATA[scheduled task]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[SQLSat]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://jdhitsolutions.com/blog/?p=2297</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
I spoke this past weekend at a SQL Saturday event in Rochester, NY. My first SQL Saturday event and it was a lot of fun. A great turnout and some very interested attendees. I did three PowerShell sessions on jobs, &#8230; <a href="http://jdhitsolutions.com/blog/2012/05/sql-saturday-129-session-material/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDExLzEwL3RhbGtidWJibGUucG5nI3V0bV9zb3VyY2U9ZmVlZCZhbXA7dXRtX21lZGl1bT1mZWVkJmFtcDt1dG1fY2FtcGFpZ249ZmVlZA=="><img src="http://jdhitsolutions.com/blog/wp-content/uploads/2011/10/talkbubble-150x150.png" alt="" title="talkbubble" width="150" height="150" class="alignleft size-thumbnail wp-image-1688" /></a>I spoke this past weekend at a <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zcWxzYXR1cmRheS5jb20vMTI5L2V2ZW50aG9tZS5hc3B4" target=\"_blank\">SQL Saturday event in Rochester, NY</a>. My first SQL Saturday event and it was a lot of fun. A great turnout and some very interested attendees. I did three PowerShell sessions on jobs, scheduled jobs/tasks and an intro to workflows. The latter talk I think blew out some neurons on a few people, but I believe they were still enthusiastic about it.</p>
<p>For SQL Saturday attendees, I&#8217;ve posted my slide deck and demo files on the conference site. For everyone else, if you are interested, I&#8217;ll also make them available here.</p>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L1Bvd2VyU2hlbGwtMy1Kb2JzLWFuZC1UYXNrcy56aXA=">PowerShell 3 Jobs and Tasks</a><br />
<a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L1Bvd2VyU2hlbGwtQmFja2dyb3VuZC1Kb2JzLnppcA==">PowerShell Background Jobs</a><br />
<a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L1Bvd2VyU2hlbGwtV29ya2Zsb3ctQmFzaWNzLnppcA==">PowerShell Workflow Basics</a></p>
<p>I expect I&#8217;ll be covering this material again in the future here as well as in my Prof. PowerShell column. And as always, if your organization is thinking about some private PowerShell training or mentoring, <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=bWFpbHRvOmpoaWNrc0BqZGhpdHNvbHV0aW9ucy5jb20/U3ViamVjdD1XZSBOZWVkIFBvd2VyU2hlbGwgVHJhaW5pbmcjdXRtX3NvdXJjZT1mZWVkJmFtcDt1dG1fbWVkaXVtPWZlZWQmYW1wO3V0bV9jYW1wYWlnbj1mZWVk" target=\"_blank\">let me know</a>.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL2ludGVudC90d2VldD90ZXh0PVNRTCtTYXR1cmRheSsxMjkrU2Vzc2lvbitNYXRlcmlhbCtodHRwJTNBJTJGJTJGamRoaXRzb2x1dGlvbnMuY29tJTJGYmxvZyUyRjIwMTIlMkYwNSUyRnNxbC1zYXR1cmRheS0xMjktc2Vzc2lvbi1tYXRlcmlhbCUyRg==" title=\"Post to Twitter\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter6.png" alt="Post to Twitter" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BsdXJrLmNvbS8/c3RhdHVzPSU1QkJMQU5LJTVE" title=\"Post to Plurk\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/plurk/tt-plurk.png" alt="Post to Plurk" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2J1enoueWFob28uY29tL2J1eno/dGFyZ2V0VXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3NxbC1zYXR1cmRheS0xMjktc2Vzc2lvbi1tYXRlcmlhbC8mYW1wO2hlYWRsaW5lPVNRTCtTYXR1cmRheSsxMjkrU2Vzc2lvbitNYXRlcmlhbA==" title=\"Post to Yahoo Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/buzz/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RlbGljaW91cy5jb20vcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvc3FsLXNhdHVyZGF5LTEyOS1zZXNzaW9uLW1hdGVyaWFsLyZhbXA7dGl0bGU9U1FMK1NhdHVyZGF5KzEyOStTZXNzaW9uK01hdGVyaWFs" title=\"Post to Delicious\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RpZ2cuY29tL3N1Ym1pdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvc3FsLXNhdHVyZGF5LTEyOS1zZXNzaW9uLW1hdGVyaWFsLyZhbXA7dGl0bGU9U1FMK1NhdHVyZGF5KzEyOStTZXNzaW9uK01hdGVyaWFs" title=\"Post to Digg\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="Post to Digg" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mYWNlYm9vay5jb20vc2hhcmUucGhwP3U9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvc3FsLXNhdHVyZGF5LTEyOS1zZXNzaW9uLW1hdGVyaWFsLyZhbXA7dD1TUUwrU2F0dXJkYXkrMTI5K1Nlc3Npb24rTWF0ZXJpYWw=" title=\"Post to Facebook\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mcmllbmRmZWVkLmNvbS9zaGFyZT90aXRsZT1TUUwrU2F0dXJkYXkrMTI5K1Nlc3Npb24rTWF0ZXJpYWwmYW1wO2xpbms9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvc3FsLXNhdHVyZGF5LTEyOS1zZXNzaW9uLW1hdGVyaWFsLw==" title=\"Post to FriendFeed\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ff/tt-ff.png" alt="Post to FriendFeed" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL2J1enovcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvc3FsLXNhdHVyZGF5LTEyOS1zZXNzaW9uLW1hdGVyaWFsLyZhbXA7aW1hZ2V1cmw9" title=\"Post to Google Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/gbuzz/tt-gbuzz.png" alt="Post to Google Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BpbmcuZm0vcmVmLz9tZXRob2Q9bWljcm9ibG9nJmFtcDt0aXRsZT1TUUwrU2F0dXJkYXkrMTI5K1Nlc3Npb24rTWF0ZXJpYWwmYW1wO2xpbms9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvc3FsLXNhdHVyZGF5LTEyOS1zZXNzaW9uLW1hdGVyaWFsLw==" title=\"Post to Ping.fm\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ping/tt-ping.png" alt="Post to Ping.fm" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JlZGRpdC5jb20vc3VibWl0P3VybD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9zcWwtc2F0dXJkYXktMTI5LXNlc3Npb24tbWF0ZXJpYWwvJmFtcDt0aXRsZT1TUUwrU2F0dXJkYXkrMTI5K1Nlc3Npb24rTWF0ZXJpYWw=" title=\"Post to Reddit\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NsYXNoZG90Lm9yZy9ib29rbWFyay5wbD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvc3FsLXNhdHVyZGF5LTEyOS1zZXNzaW9uLW1hdGVyaWFsLyZhbXA7dGl0bGU9U1FMK1NhdHVyZGF5KzEyOStTZXNzaW9uK01hdGVyaWFs" title=\"Post to Slashdot\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/slashdot/tt-slashdot.png" alt="Post to Slashdot" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dW1ibGV1cG9uLmNvbS9zdWJtaXQ/dXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3NxbC1zYXR1cmRheS0xMjktc2Vzc2lvbi1tYXRlcmlhbC8mYW1wO3RpdGxlPVNRTCtTYXR1cmRheSsxMjkrU2Vzc2lvbitNYXRlcmlhbA==" title=\"Post to StumbleUpon\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL2ZhdmVzP2FkZD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9zcWwtc2F0dXJkYXktMTI5LXNlc3Npb24tbWF0ZXJpYWwv" title=\"Post to Technorati\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/technorati/tt-technorati.png" alt="Post to Technorati" /></a></p></div> <img src="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2297" width="1" height="1" style="display: none;" />
<p><a href="http://feedads.g.doubleclick.net/~a/fUwgAe6NQaqQbAuG3ZAMMjDJiBE/0/da"><img src="http://feedads.g.doubleclick.net/~a/fUwgAe6NQaqQbAuG3ZAMMjDJiBE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/fUwgAe6NQaqQbAuG3ZAMMjDJiBE/1/da"><img src="http://feedads.g.doubleclick.net/~a/fUwgAe6NQaqQbAuG3ZAMMjDJiBE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/v4vWNydTKrw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jdhitsolutions.com/blog/2012/05/sql-saturday-129-session-material/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://jdhitsolutions.com/blog/2012/05/sql-saturday-129-session-material/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=sql-saturday-129-session-material</feedburner:origLink></item>
		<item>
		<title>Friday Fun: PowerShell ISE Function Finder</title>
		<link>http://feedproxy.google.com/~r/JeffsScriptingBlogAndMore/~3/xZE8pRl0gMk/</link>
		<comments>http://jdhitsolutions.com/blog/2012/05/friday-fun-powershell-ise-function-finder/#comments</comments>
		<pubDate>Fri, 11 May 2012 13:37:07 +0000</pubDate>
		<dc:creator>Jeffery Hicks</dc:creator>
				<category><![CDATA[Friday Fun]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PowerShell ISE]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[ISE]]></category>
		<category><![CDATA[Out-Gridview]]></category>
		<category><![CDATA[ShowUI]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://jdhitsolutions.com/blog/?p=2287</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
At the PowerShell Deep Dive in San Diego, I did a lightning session showing off something I had been working on. Sometimes I don&#8217;t know what possesses me, but I felt the need for a better way to navigate my &#8230; <a href="http://jdhitsolutions.com/blog/2012/05/friday-fun-powershell-ise-function-finder/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p>At the PowerShell Deep Dive in San Diego, I did a lightning session showing off something I had been working on. Sometimes I don&#8217;t know what possesses me, but I felt the need for a better way to navigate my PowerShell scripts files that had many functions. Some files, especially modules, can get quite long and contain a number of functions. When using the PowerShell ISE I wanted a faster way to jump to a function. The problem is I don&#8217;t always remember what I called a function or where it is in the file. It is very easy to jump to a particular line in the ISE using the Ctrl+G shortcut. </p>
<p>So I started with some basics.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$Path</span><span style="color: pink;">=</span><span style="color: #800080;">$psise</span>.CurrentFile.FullPath</div></div>
<p>I decided I&#8217;d use a regular expression pattern to find my functions. I write my functions like this:</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">Function</span> Get<span style="color: pink;">-</span>Foo <span style="color: #000000;">&#123;</span><br />
<br />
<span style="color: #0000FF;">Param</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
...</div></div>
<p>So I came up with a regex pattern to match the first line and to include the Filter keyword as well.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">&#91;</span><span style="color: #008080;">regex</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$r</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;^(Function|Filter)\s\S+\s{&quot;</span></div></div>
<p>I first thought of searching the content of the current file, but that won&#8217;t give me a line number. Then I thought of Select-String. With my regex pattern, I can get the content of the current file and pipe it to Select-String. The match object that comes out the other end of the pipeline includes a line number property (awesome) and the matching line. I decided to do a little string parsing on the later to drop off the trailing curly brace.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$list</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">get-content</span> <span style="color: #800080;">$path</span> <span style="color: pink;">|</span> <br />
&nbsp;<span style="color: #008080; font-weight: bold;">select-string</span> <span style="color: #800080;">$r</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Select</span> LineNumber<span style="color: pink;">,</span><br />
&nbsp;<span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>Name<span style="color: pink;">=</span><span style="color: #800000;">&quot;Function&quot;</span>;Expression<span style="color: pink;">=</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.Line.Split<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span></div></div>
<p>Because I&#8217;m in the ISE I felt the need to stay graphical, so my first thought was to pipe the results to Out-Gridview.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$list</span> <span style="color: pink;">|</span> out<span style="color: pink;">-</span>gridview <span style="color: #008080; font-style: italic;">-Title</span> <span style="color: #800080;">$psise</span>.CurrentFile.FullPath</div></div>
<p>Here&#8217;s a sample result.</p>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L2Z1bmN0aW9ubGlzdC1ncmlkdmlldy5wbmcjdXRtX3NvdXJjZT1mZWVkJmFtcDt1dG1fbWVkaXVtPWZlZWQmYW1wO3V0bV9jYW1wYWlnbj1mZWVk"><img src="http://jdhitsolutions.com/blog/wp-content/uploads/2012/05/functionlist-gridview-252x300.png" alt="" title="functionlist-gridview" width="252" height="300" class="aligncenter size-medium wp-image-2288" /></a></p>
<p>Now I can see the function name and line number. In the ISE I can do Ctrl+G and jump to the function. Of course, if I modify the file and line numbers change I need to close the grid and re-run my command.  But wait, there&#8217;s more&#8230;.</p>
<p>I&#8217;ve never done much with the WPF and figured this would be a great opportunity to do something with the <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3Nob3d1aS5jb2RlcGxleC5jb20v" title=\"Get the module from CodePlex\" target=\"_blank\">ShowUI</a> module. I already had the data. All I had to do was create a form with ShowUI. This is what I ended up with.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$n</span><span style="color: pink;">=</span><span style="color: #800080;">$psise</span>.CurrentFile.DisplayName <br />
ScrollViewer <span style="color: pink;">-</span>ControlName <span style="color: #800080;">$n</span> <span style="color: pink;">-</span>CanContentScroll &nbsp;<span style="color: pink;">-</span>tag <span style="color: #800080;">$psise</span>.CurrentFile.FullPath <span style="color: pink;">-</span>content <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;StackPanel &nbsp;<span style="color: pink;">-</span>MinWidth <span style="color: #804000;">300</span> <span style="color: pink;">-</span>MaxHeight <span style="color: #804000;">250</span> &nbsp;`<br />
&nbsp; &nbsp; &nbsp;<span style="color: pink;">-</span>orientation Vertical <span style="color: pink;">-</span>Children <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">#get longest number if more than one function is found</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$count</span> <span style="color: #FF0000;">-eq</span> <span style="color: #804000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$i</span><span style="color: pink;">=</span><span style="color: #800080;">$list</span>.Linenumber<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">else</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$i</span><span style="color: pink;">=</span><span style="color: #800080;">$list</span><span style="color: #000000;">&#91;</span><span style="color: pink;">-</span><span style="color: #804000;">1</span><span style="color: #000000;">&#93;</span>.Linenumber<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$l</span><span style="color: pink;">=</span><span style="color: #800080;">$i</span>.length<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$item</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$list</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$text</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;{0:d$l} &nbsp; &nbsp;{1}&quot;</span> <span style="color: #FF0000;">-f</span> <span style="color: #800080;">$item</span>.linenumber<span style="color: pink;">,</span><span style="color: #800080;">$item</span>.<span style="color: #0000FF;">function</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Button <span style="color: #800080;">$text</span> <span style="color: pink;">-</span>HorizontalContentAlignment Left <span style="color: pink;">-</span>On_Click <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">#get the line number</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">regex</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$num</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;^\d+&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">#parse out the line number</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$goto</span> <span style="color: pink;">=</span> <span style="color: #800080;">$num</span>.match<span style="color: #000000;">&#40;</span><span style="color: #800080;">$this</span>.content<span style="color: #000000;">&#41;</span>.value<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">#grab the file name from the tab value of the parent control</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$f</span><span style="color: pink;">=</span> <span style="color: #800080;">$parent</span> <span style="color: pink;">|</span> get<span style="color: pink;">-</span>uivalue<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">#Open the file in the editor</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; psedit <span style="color: #800080;">$f</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">#goto the selected line</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$psise</span>.CurrentFile.Editor.SetCaretPosition<span style="color: #000000;">&#40;</span><span style="color: #800080;">$goto</span><span style="color: pink;">,</span><span style="color: #804000;">1</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">#close the control</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Get<span style="color: pink;">-</span>ParentControl <span style="color: pink;">|</span> Set<span style="color: pink;">-</span>UIValue <span style="color: #008080; font-style: italic;">-PassThru</span> <span style="color: pink;">|</span>Close<span style="color: pink;">-</span>Control<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span> <span style="color: #008000;">#onclick</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span> <span style="color: #008000;">#foreach</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span> <br />
&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span> <span style="color: pink;">-</span>show</div></div>
<p>The result is a stack panel of buttons in a scroll control. The button shows the line number and function name.</p>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L2Z1bmN0aW9ubGlzdC1zaG93dWkucG5nI3V0bV9zb3VyY2U9ZmVlZCZhbXA7dXRtX21lZGl1bT1mZWVkJmFtcDt1dG1fY2FtcGFpZ249ZmVlZA=="><img src="http://jdhitsolutions.com/blog/wp-content/uploads/2012/05/functionlist-showui-300x259.png" alt="" title="functionlist-showui" width="300" height="259" class="aligncenter size-medium wp-image-2290" /></a></p>
<p>When a button is clicked, the function gets the line number and automatically jumps to it. Originally I was leaving the control open, but this means the function is still running. And if I change the script the line numbers are off so I simply close the form after jumping to the function. </p>
<p>In the end, I packaged all of this as a script file that adds a menu choice. If ShowUI is available, the function will use it. Otherwise the function defaults to Out-GridView.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">Function</span> Get<span style="color: pink;">-</span>ISEFunction <span style="color: #000000;">&#123;</span><br />
<br />
<span style="color: #000000;">&#91;</span>cmdletbinding<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #0000FF;">Param</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$Path</span><span style="color: pink;">=</span><span style="color: #800080;">$psise</span>.CurrentFile.FullPath<span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #008000;">#import ShowUI if found and use it later in the functoin</span><br />
<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>module <span style="color: #008080; font-style: italic;">-name</span> ShowUI <span style="color: pink;">-</span>listavailable<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; Import<span style="color: pink;">-</span>Module ShowUI<br />
&nbsp; &nbsp; <span style="color: #800080;">$showui</span><span style="color: pink;">=</span><span style="color: #800080;">$True</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #0000FF;">else</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Verbose</span> <span style="color: #800000;">&quot;Using Out-GridView&quot;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$showui</span><span style="color: pink;">=</span><span style="color: #800080;">$False</span><br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #008000;">#define a regex to find &quot;function | filter NAME {&quot;</span><br />
<span style="color: #000000;">&#91;</span><span style="color: #008080;">regex</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$r</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;^(Function|Filter)\s\S+\s{&quot;</span><br />
<br />
<span style="color: #800080;">$list</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">get-content</span> <span style="color: #800080;">$path</span> <span style="color: pink;">|</span> <br />
&nbsp;<span style="color: #008080; font-weight: bold;">select-string</span> <span style="color: #800080;">$r</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Select</span> LineNumber<span style="color: pink;">,</span><br />
&nbsp;<span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>Name<span style="color: pink;">=</span><span style="color: #800000;">&quot;Function&quot;</span>;Expression<span style="color: pink;">=</span><span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.Line.Split<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #008000;">#were any functions found?</span><br />
<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$list</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$count</span><span style="color: pink;">=</span><span style="color: #800080;">$list</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">measure-object</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Select-object</span> <span style="color: #008080; font-style: italic;">-ExpandProperty</span> Count<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Verbose</span> <span style="color: #800000;">&quot;Found $count functions&quot;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$showui</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #008000;">&lt;#<br />
&nbsp; &nbsp; &nbsp; &nbsp; display function list with a WPF Form from ShowUI<br />
&nbsp; &nbsp; &nbsp; &nbsp; Include file name so the right tab can get selected<br />
&nbsp; &nbsp; &nbsp;#&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$n</span><span style="color: pink;">=</span><span style="color: #800080;">$psise</span>.CurrentFile.DisplayName<br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Verbose</span> <span style="color: #800000;">&quot;Building list for $n&quot;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; ScrollViewer <span style="color: pink;">-</span>ControlName <span style="color: #800080;">$n</span> <span style="color: pink;">-</span>CanContentScroll &nbsp;<span style="color: pink;">-</span>tag <span style="color: #800080;">$psise</span>.CurrentFile.FullPath <span style="color: pink;">-</span>content <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;StackPanel &nbsp;<span style="color: pink;">-</span>MinWidth <span style="color: #804000;">300</span> <span style="color: pink;">-</span>MaxHeight <span style="color: #804000;">250</span> &nbsp;`<br />
&nbsp; &nbsp; &nbsp;<span style="color: pink;">-</span>orientation Vertical <span style="color: pink;">-</span>Children <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">#get longest number if more than one function is found</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$count</span> <span style="color: #FF0000;">-eq</span> <span style="color: #804000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$i</span><span style="color: pink;">=</span><span style="color: #800080;">$list</span>.Linenumber<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">else</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$i</span><span style="color: pink;">=</span><span style="color: #800080;">$list</span><span style="color: #000000;">&#91;</span><span style="color: pink;">-</span><span style="color: #804000;">1</span><span style="color: #000000;">&#93;</span>.Linenumber<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$l</span><span style="color: pink;">=</span><span style="color: #800080;">$i</span>.length<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$item</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$list</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$text</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;{0:d$l} &nbsp; &nbsp;{1}&quot;</span> <span style="color: #FF0000;">-f</span> <span style="color: #800080;">$item</span>.linenumber<span style="color: pink;">,</span><span style="color: #800080;">$item</span>.<span style="color: #0000FF;">function</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Verbose</span> <span style="color: #800080;">$text</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Button <span style="color: #800080;">$text</span> <span style="color: pink;">-</span>HorizontalContentAlignment Left <span style="color: pink;">-</span>On_Click <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">#get the line number</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">regex</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$num</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;^\d+&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">#parse out the line number</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$goto</span> <span style="color: pink;">=</span> <span style="color: #800080;">$num</span>.match<span style="color: #000000;">&#40;</span><span style="color: #800080;">$this</span>.content<span style="color: #000000;">&#41;</span>.value<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">#grab the file name from the tab value of the parent control</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$f</span><span style="color: pink;">=</span> <span style="color: #800080;">$parent</span> <span style="color: pink;">|</span> get<span style="color: pink;">-</span>uivalue<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">#Open the file in the editor</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; psedit <span style="color: #800080;">$f</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">#goto the selected line</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$psise</span>.CurrentFile.Editor.SetCaretPosition<span style="color: #000000;">&#40;</span><span style="color: #800080;">$goto</span><span style="color: pink;">,</span><span style="color: #804000;">1</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">#close the control</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Get<span style="color: pink;">-</span>ParentControl <span style="color: pink;">|</span> Set<span style="color: pink;">-</span>UIValue <span style="color: #008080; font-style: italic;">-PassThru</span> <span style="color: pink;">|</span>Close<span style="color: pink;">-</span>Control<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span> <span style="color: #008000;">#onclick</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span> <span style="color: #008000;">#foreach</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span> <br />
&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span> <span style="color: pink;">-</span>show <br />
<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span> <span style="color: #008000;">#if $showui</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">else</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">#no ShowUI module so use Out-GridView</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$list</span> <span style="color: pink;">|</span> out<span style="color: pink;">-</span>gridview <span style="color: #008080; font-style: italic;">-Title</span> <span style="color: #800080;">$psise</span>.CurrentFile.FullPath<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp;<span style="color: #000000;">&#125;</span><br />
<span style="color: #0000FF;">else</span> <span style="color: #000000;">&#123;</span><br />
&nbsp;<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;No functions found in $($psise.CurrentFile.FullPath)&quot;</span> <span style="color: #008080; font-style: italic;">-ForegroundColor</span> Magenta<br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #000000;">&#125;</span> <span style="color: #008000;">#close function</span><br />
<br />
<span style="color: #008000;">#Add to the Add-ons menu</span><br />
<span style="color: #800080;">$PSISE</span>.CurrentPowerShellTab.AddOnsMenu.Submenus.Add<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;List Functions&quot;</span><span style="color: pink;">,</span><span style="color: #000000;">&#123;</span>Get<span style="color: pink;">-</span>ISEFunction<span style="color: #000000;">&#125;</span><span style="color: pink;">,</span><span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #008000;">#optional alias</span><br />
<span style="color: #008080; font-weight: bold;">set-alias</span> gif get<span style="color: pink;">-</span>isefunction</div></div>
<p>Now, I can click the List Functions menu choice and I&#8217;ll get a graphical list of any functions in the current file. I&#8217;m sure the regex could be tweaked. I&#8217;m also sure there are improvements I could make to the ShowUI code, but it works.</p>
<p>Download <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L0dldC1JU0VGdW5jdGlvbi50eHQ=" target='_blank'>Get-ISEFunction</a> and let me know what you think.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL2ludGVudC90d2VldD90ZXh0PUZyaWRheStGdW4lM0ErUG93ZXJTaGVsbCtJU0UrRnVuY3Rpb24rRmluZGVyK2h0dHAlM0ElMkYlMkZqZGhpdHNvbHV0aW9ucy5jb20lMkZibG9nJTJGMjAxMiUyRjA1JTJGZnJpZGF5LWZ1bi1wb3dlcnNoZWxsLWlzZS1mdW5jdGlvbi1maW5kZXIlMkY=" title=\"Post to Twitter\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter6.png" alt="Post to Twitter" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BsdXJrLmNvbS8/c3RhdHVzPSU1QkJMQU5LJTVE" title=\"Post to Plurk\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/plurk/tt-plurk.png" alt="Post to Plurk" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2J1enoueWFob28uY29tL2J1eno/dGFyZ2V0VXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L2ZyaWRheS1mdW4tcG93ZXJzaGVsbC1pc2UtZnVuY3Rpb24tZmluZGVyLyZhbXA7aGVhZGxpbmU9RnJpZGF5K0Z1biUzQStQb3dlclNoZWxsK0lTRStGdW5jdGlvbitGaW5kZXI=" title=\"Post to Yahoo Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/buzz/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RlbGljaW91cy5jb20vcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZnJpZGF5LWZ1bi1wb3dlcnNoZWxsLWlzZS1mdW5jdGlvbi1maW5kZXIvJmFtcDt0aXRsZT1GcmlkYXkrRnVuJTNBK1Bvd2VyU2hlbGwrSVNFK0Z1bmN0aW9uK0ZpbmRlcg==" title=\"Post to Delicious\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RpZ2cuY29tL3N1Ym1pdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZnJpZGF5LWZ1bi1wb3dlcnNoZWxsLWlzZS1mdW5jdGlvbi1maW5kZXIvJmFtcDt0aXRsZT1GcmlkYXkrRnVuJTNBK1Bvd2VyU2hlbGwrSVNFK0Z1bmN0aW9uK0ZpbmRlcg==" title=\"Post to Digg\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="Post to Digg" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mYWNlYm9vay5jb20vc2hhcmUucGhwP3U9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZnJpZGF5LWZ1bi1wb3dlcnNoZWxsLWlzZS1mdW5jdGlvbi1maW5kZXIvJmFtcDt0PUZyaWRheStGdW4lM0ErUG93ZXJTaGVsbCtJU0UrRnVuY3Rpb24rRmluZGVy" title=\"Post to Facebook\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mcmllbmRmZWVkLmNvbS9zaGFyZT90aXRsZT1GcmlkYXkrRnVuJTNBK1Bvd2VyU2hlbGwrSVNFK0Z1bmN0aW9uK0ZpbmRlciZhbXA7bGluaz1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9mcmlkYXktZnVuLXBvd2Vyc2hlbGwtaXNlLWZ1bmN0aW9uLWZpbmRlci8=" title=\"Post to FriendFeed\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ff/tt-ff.png" alt="Post to FriendFeed" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL2J1enovcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZnJpZGF5LWZ1bi1wb3dlcnNoZWxsLWlzZS1mdW5jdGlvbi1maW5kZXIvJmFtcDtpbWFnZXVybD0=" title=\"Post to Google Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/gbuzz/tt-gbuzz.png" alt="Post to Google Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BpbmcuZm0vcmVmLz9tZXRob2Q9bWljcm9ibG9nJmFtcDt0aXRsZT1GcmlkYXkrRnVuJTNBK1Bvd2VyU2hlbGwrSVNFK0Z1bmN0aW9uK0ZpbmRlciZhbXA7bGluaz1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9mcmlkYXktZnVuLXBvd2Vyc2hlbGwtaXNlLWZ1bmN0aW9uLWZpbmRlci8=" title=\"Post to Ping.fm\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ping/tt-ping.png" alt="Post to Ping.fm" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JlZGRpdC5jb20vc3VibWl0P3VybD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9mcmlkYXktZnVuLXBvd2Vyc2hlbGwtaXNlLWZ1bmN0aW9uLWZpbmRlci8mYW1wO3RpdGxlPUZyaWRheStGdW4lM0ErUG93ZXJTaGVsbCtJU0UrRnVuY3Rpb24rRmluZGVy" title=\"Post to Reddit\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NsYXNoZG90Lm9yZy9ib29rbWFyay5wbD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvZnJpZGF5LWZ1bi1wb3dlcnNoZWxsLWlzZS1mdW5jdGlvbi1maW5kZXIvJmFtcDt0aXRsZT1GcmlkYXkrRnVuJTNBK1Bvd2VyU2hlbGwrSVNFK0Z1bmN0aW9uK0ZpbmRlcg==" title=\"Post to Slashdot\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/slashdot/tt-slashdot.png" alt="Post to Slashdot" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dW1ibGV1cG9uLmNvbS9zdWJtaXQ/dXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L2ZyaWRheS1mdW4tcG93ZXJzaGVsbC1pc2UtZnVuY3Rpb24tZmluZGVyLyZhbXA7dGl0bGU9RnJpZGF5K0Z1biUzQStQb3dlclNoZWxsK0lTRStGdW5jdGlvbitGaW5kZXI=" title=\"Post to StumbleUpon\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL2ZhdmVzP2FkZD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9mcmlkYXktZnVuLXBvd2Vyc2hlbGwtaXNlLWZ1bmN0aW9uLWZpbmRlci8=" title=\"Post to Technorati\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/technorati/tt-technorati.png" alt="Post to Technorati" /></a></p></div> <img src="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2287" width="1" height="1" style="display: none;" />
<p><a href="http://feedads.g.doubleclick.net/~a/xVr_GSdmB6f0SbaJgd4hmv0tSek/0/da"><img src="http://feedads.g.doubleclick.net/~a/xVr_GSdmB6f0SbaJgd4hmv0tSek/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xVr_GSdmB6f0SbaJgd4hmv0tSek/1/da"><img src="http://feedads.g.doubleclick.net/~a/xVr_GSdmB6f0SbaJgd4hmv0tSek/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/xZE8pRl0gMk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jdhitsolutions.com/blog/2012/05/friday-fun-powershell-ise-function-finder/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://jdhitsolutions.com/blog/2012/05/friday-fun-powershell-ise-function-finder/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=friday-fun-powershell-ise-function-finder</feedburner:origLink></item>
		<item>
		<title>Quick and Dirty Excel from PowerShell</title>
		<link>http://feedproxy.google.com/~r/JeffsScriptingBlogAndMore/~3/iA0zkOGBdF0/</link>
		<comments>http://jdhitsolutions.com/blog/2012/05/quick-and-dirty-excel-from-powershell/#comments</comments>
		<pubDate>Thu, 10 May 2012 12:56:43 +0000</pubDate>
		<dc:creator>Jeffery Hicks</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://jdhitsolutions.com/blog/?p=2281</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
I continue to tinker with Office applications and Windows PowerShell. I was looking at an Excel issue related to opening a new workbook. To verify the problem wasn&#8217;t PowerShell related I offered a suggestion to try creating an Excel workbook &#8230; <a href="http://jdhitsolutions.com/blog/2012/05/quick-and-dirty-excel-from-powershell/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L2V4Y2VsXzIwMTBfbG9nby5wbmcjdXRtX3NvdXJjZT1mZWVkJmFtcDt1dG1fbWVkaXVtPWZlZWQmYW1wO3V0bV9jYW1wYWlnbj1mZWVk"><img src="http://jdhitsolutions.com/blog/wp-content/uploads/2012/05/excel_2010_logo-150x150.png" alt="" title="excel_2010_logo" width="150" height="150" class="alignleft size-thumbnail wp-image-2282" /></a> I continue to tinker with Office applications and Windows PowerShell. I was looking at an Excel issue related to opening a new workbook. To verify the problem wasn&#8217;t PowerShell related I offered a suggestion to try creating an Excel workbook in VBScript.</p>
<p>In VBScript creating a blank workbook in Microsoft Excel can be accomplished with three lines of code.</p>
<div class="codecolorer-container vb geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #151B8D; font-weight: bold;">set</span> xl=wscript.<span style="color: #E56717; font-weight: bold;">createObject</span>(<span style="color: #800000;">&quot;Excel.Application&quot;</span>)<br />
<span style="color: #151B8D; font-weight: bold;">set</span> wb=xl.workbooks.add()<br />
xl.Visible=vbTrue</div></div>
<p>In Windows PowerShell we essentially use the same 3 lines.</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$xl</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">new-object</span> <span style="color: pink;">-</span>com <span style="color: #800000;">&quot;excel.application&quot;</span><br />
<span style="color: #800080;">$sb</span><span style="color: pink;">=</span><span style="color: #800080;">$xl</span>.Workbooks.Add<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$xl</span>.Visible<span style="color: pink;">=</span>$True</div></div>
<p>But PowerShell is all about the objects, so how about a quick and dirty approach? Something perhaps in one line:</p>
<div class="codecolorer-container powershell geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-weight: bold;">PS</span> S:\<span style="color: pink;">&gt;</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">new-object</span> <span style="color: pink;">-</span>com <span style="color: #800000;">&quot;excel.application&quot;</span><span style="color: #000000;">&#41;</span>.Workbooks.Add<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.application.Visible<span style="color: pink;">=</span>$True</div></div>
<p>You could easily build a simple function to run the 3 lines it takes to open a new Excel workbook but one-liners like this make me smile. Granted, I&#8217;m probably not likely to use it, but if nothing else I think it reinforces the object nature of Windows PowerShell. </p>
<p>Each expression nested in () is treated as an object. The inner most expression using New-Object, creates the Excel application object which has a Workbooks property that is an object with an Add() method. Invoking this method creates the workbook object. If I stopped there Excel would be running but not visible. So I get the Application property of the workbook object, and set the Visible property to True.</p>
<p>This command doesn&#8217;t offer any way to continue working with Excel from PowerShell; it only opens a new workbook. Let me be clear, I&#8217;m not advocating that this is how you work with Excel from PowerShell. I think you will need scripts like the ones I posted from my <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2JpdC5seS9JWVhwT0Y=" title=\"San Diego 2012 PowerShell Deep Dive Slides and Demos\" target=\"_blank\">Deep Dive session</a>. But this one-liner demonstrates what is possible with PowerShell and maybe it will add a little smile to your day as well.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL2ludGVudC90d2VldD90ZXh0PVF1aWNrK2FuZCtEaXJ0eStFeGNlbCtmcm9tK1Bvd2VyU2hlbGwraHR0cCUzQSUyRiUyRmpkaGl0c29sdXRpb25zLmNvbSUyRmJsb2clMkYyMDEyJTJGMDUlMkZxdWljay1hbmQtZGlydHktZXhjZWwtZnJvbS1wb3dlcnNoZWxsJTJG" title=\"Post to Twitter\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter6.png" alt="Post to Twitter" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BsdXJrLmNvbS8/c3RhdHVzPSU1QkJMQU5LJTVE" title=\"Post to Plurk\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/plurk/tt-plurk.png" alt="Post to Plurk" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2J1enoueWFob28uY29tL2J1eno/dGFyZ2V0VXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3F1aWNrLWFuZC1kaXJ0eS1leGNlbC1mcm9tLXBvd2Vyc2hlbGwvJmFtcDtoZWFkbGluZT1RdWljaythbmQrRGlydHkrRXhjZWwrZnJvbStQb3dlclNoZWxs" title=\"Post to Yahoo Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/buzz/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RlbGljaW91cy5jb20vcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVpY2stYW5kLWRpcnR5LWV4Y2VsLWZyb20tcG93ZXJzaGVsbC8mYW1wO3RpdGxlPVF1aWNrK2FuZCtEaXJ0eStFeGNlbCtmcm9tK1Bvd2VyU2hlbGw=" title=\"Post to Delicious\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RpZ2cuY29tL3N1Ym1pdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVpY2stYW5kLWRpcnR5LWV4Y2VsLWZyb20tcG93ZXJzaGVsbC8mYW1wO3RpdGxlPVF1aWNrK2FuZCtEaXJ0eStFeGNlbCtmcm9tK1Bvd2VyU2hlbGw=" title=\"Post to Digg\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="Post to Digg" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mYWNlYm9vay5jb20vc2hhcmUucGhwP3U9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVpY2stYW5kLWRpcnR5LWV4Y2VsLWZyb20tcG93ZXJzaGVsbC8mYW1wO3Q9UXVpY2srYW5kK0RpcnR5K0V4Y2VsK2Zyb20rUG93ZXJTaGVsbA==" title=\"Post to Facebook\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mcmllbmRmZWVkLmNvbS9zaGFyZT90aXRsZT1RdWljaythbmQrRGlydHkrRXhjZWwrZnJvbStQb3dlclNoZWxsJmFtcDtsaW5rPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3F1aWNrLWFuZC1kaXJ0eS1leGNlbC1mcm9tLXBvd2Vyc2hlbGwv" title=\"Post to FriendFeed\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ff/tt-ff.png" alt="Post to FriendFeed" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL2J1enovcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVpY2stYW5kLWRpcnR5LWV4Y2VsLWZyb20tcG93ZXJzaGVsbC8mYW1wO2ltYWdldXJsPQ==" title=\"Post to Google Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/gbuzz/tt-gbuzz.png" alt="Post to Google Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BpbmcuZm0vcmVmLz9tZXRob2Q9bWljcm9ibG9nJmFtcDt0aXRsZT1RdWljaythbmQrRGlydHkrRXhjZWwrZnJvbStQb3dlclNoZWxsJmFtcDtsaW5rPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3F1aWNrLWFuZC1kaXJ0eS1leGNlbC1mcm9tLXBvd2Vyc2hlbGwv" title=\"Post to Ping.fm\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ping/tt-ping.png" alt="Post to Ping.fm" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JlZGRpdC5jb20vc3VibWl0P3VybD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9xdWljay1hbmQtZGlydHktZXhjZWwtZnJvbS1wb3dlcnNoZWxsLyZhbXA7dGl0bGU9UXVpY2srYW5kK0RpcnR5K0V4Y2VsK2Zyb20rUG93ZXJTaGVsbA==" title=\"Post to Reddit\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NsYXNoZG90Lm9yZy9ib29rbWFyay5wbD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvcXVpY2stYW5kLWRpcnR5LWV4Y2VsLWZyb20tcG93ZXJzaGVsbC8mYW1wO3RpdGxlPVF1aWNrK2FuZCtEaXJ0eStFeGNlbCtmcm9tK1Bvd2VyU2hlbGw=" title=\"Post to Slashdot\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/slashdot/tt-slashdot.png" alt="Post to Slashdot" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dW1ibGV1cG9uLmNvbS9zdWJtaXQ/dXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3F1aWNrLWFuZC1kaXJ0eS1leGNlbC1mcm9tLXBvd2Vyc2hlbGwvJmFtcDt0aXRsZT1RdWljaythbmQrRGlydHkrRXhjZWwrZnJvbStQb3dlclNoZWxs" title=\"Post to StumbleUpon\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL2ZhdmVzP2FkZD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9xdWljay1hbmQtZGlydHktZXhjZWwtZnJvbS1wb3dlcnNoZWxsLw==" title=\"Post to Technorati\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/technorati/tt-technorati.png" alt="Post to Technorati" /></a></p></div> <img src="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2281" width="1" height="1" style="display: none;" />
<p><a href="http://feedads.g.doubleclick.net/~a/qbZhmqUDrAb_8qdHIIp5T58i5FQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/qbZhmqUDrAb_8qdHIIp5T58i5FQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/qbZhmqUDrAb_8qdHIIp5T58i5FQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/qbZhmqUDrAb_8qdHIIp5T58i5FQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/iA0zkOGBdF0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jdhitsolutions.com/blog/2012/05/quick-and-dirty-excel-from-powershell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://jdhitsolutions.com/blog/2012/05/quick-and-dirty-excel-from-powershell/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=quick-and-dirty-excel-from-powershell</feedburner:origLink></item>
		<item>
		<title>San Diego 2012 PowerShell Deep Dive Slides and Demos</title>
		<link>http://feedproxy.google.com/~r/JeffsScriptingBlogAndMore/~3/78lbqF9MLc8/</link>
		<comments>http://jdhitsolutions.com/blog/2012/05/san-diego-2012-powershell-deep-dive-slides-and-demos/#comments</comments>
		<pubDate>Tue, 08 May 2012 14:30:52 +0000</pubDate>
		<dc:creator>Jeffery Hicks</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[DeepDive]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[TEC]]></category>

		<guid isPermaLink="false">http://jdhitsolutions.com/blog/?p=2273</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
Last week at the PowerShell Deep Dive in San Diego, I did a short presentation on integrating Microsoft Office applications like Excel and Word with Windows PowerShell. I easily could have spoken much longer and probably tried to cram too &#8230; <a href="http://jdhitsolutions.com/blog/2012/05/san-diego-2012-powershell-deep-dive-slides-and-demos/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p><a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L01pY3Jvc29mdF9Xb3JkX0ljb24ucG5nI3V0bV9zb3VyY2U9ZmVlZCZhbXA7dXRtX21lZGl1bT1mZWVkJmFtcDt1dG1fY2FtcGFpZ249ZmVlZA=="><img src="http://jdhitsolutions.com/blog/wp-content/uploads/2012/05/Microsoft_Word_Icon-150x150.png" alt="" title="Microsoft_Word_Icon" width="150" height="150" class="alignleft size-thumbnail wp-image-2274" /></a> Last week at the PowerShell Deep Dive in San Diego, I did a short presentation on integrating Microsoft Office applications like Excel and Word with Windows PowerShell. I easily could have spoken much longer and probably tried to cram too much in. I spent a lot of time with my demos. I expect at some point a video of my talk will be posted on the TEC site.  In the mean time you can <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L0ludGVncmF0aW5nX09mZmljZV9Qb3dlclNoZWxsLnBkZg==">download a PDF of my slide deck</a> and a <a href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEyLzA1L1Bvd2VyU2hlbGwtT2ZmaWNlRGVtb3Muemlw">zip file</a> with all of my demos. Some of the scripts have been revised slightly since my presentation. The scripts are NOT intended for production use. They are demonstration and proof-of-concept scripts. Many of them have hard coded paths for additional files so read them carefully before you try to run. I&#8217;ve tried to comment extensively so you can understand what is going on, but this is admittedly a complicated topic. I&#8217;m hoping to create some additional videos around these demos, but if you have questions please post a comment.</p>
<p>Enjoy.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL2ludGVudC90d2VldD90ZXh0PVNhbitEaWVnbysyMDEyK1Bvd2VyU2hlbGwrRGVlcCtEaXZlK1NsaWRlcythbmQrRGVtb3MraHR0cCUzQSUyRiUyRmJpdC5seSUyRklZWHBPRg==" title=\"Post to Twitter\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter6.png" alt="Post to Twitter" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BsdXJrLmNvbS8/c3RhdHVzPSU1QkJMQU5LJTVE" title=\"Post to Plurk\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/plurk/tt-plurk.png" alt="Post to Plurk" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2J1enoueWFob28uY29tL2J1eno/dGFyZ2V0VXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3Nhbi1kaWVnby0yMDEyLXBvd2Vyc2hlbGwtZGVlcC1kaXZlLXNsaWRlcy1hbmQtZGVtb3MvJmFtcDtoZWFkbGluZT1TYW4rRGllZ28rMjAxMitQb3dlclNoZWxsK0RlZXArRGl2ZStTbGlkZXMrYW5kK0RlbW9z" title=\"Post to Yahoo Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/buzz/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RlbGljaW91cy5jb20vcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvc2FuLWRpZWdvLTIwMTItcG93ZXJzaGVsbC1kZWVwLWRpdmUtc2xpZGVzLWFuZC1kZW1vcy8mYW1wO3RpdGxlPVNhbitEaWVnbysyMDEyK1Bvd2VyU2hlbGwrRGVlcCtEaXZlK1NsaWRlcythbmQrRGVtb3M=" title=\"Post to Delicious\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="Post to Delicious" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RpZ2cuY29tL3N1Ym1pdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvc2FuLWRpZWdvLTIwMTItcG93ZXJzaGVsbC1kZWVwLWRpdmUtc2xpZGVzLWFuZC1kZW1vcy8mYW1wO3RpdGxlPVNhbitEaWVnbysyMDEyK1Bvd2VyU2hlbGwrRGVlcCtEaXZlK1NsaWRlcythbmQrRGVtb3M=" title=\"Post to Digg\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="Post to Digg" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mYWNlYm9vay5jb20vc2hhcmUucGhwP3U9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvc2FuLWRpZWdvLTIwMTItcG93ZXJzaGVsbC1kZWVwLWRpdmUtc2xpZGVzLWFuZC1kZW1vcy8mYW1wO3Q9U2FuK0RpZWdvKzIwMTIrUG93ZXJTaGVsbCtEZWVwK0RpdmUrU2xpZGVzK2FuZCtEZW1vcw==" title=\"Post to Facebook\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="Post to Facebook" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mcmllbmRmZWVkLmNvbS9zaGFyZT90aXRsZT1TYW4rRGllZ28rMjAxMitQb3dlclNoZWxsK0RlZXArRGl2ZStTbGlkZXMrYW5kK0RlbW9zJmFtcDtsaW5rPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3Nhbi1kaWVnby0yMDEyLXBvd2Vyc2hlbGwtZGVlcC1kaXZlLXNsaWRlcy1hbmQtZGVtb3Mv" title=\"Post to FriendFeed\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ff/tt-ff.png" alt="Post to FriendFeed" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL2J1enovcG9zdD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvc2FuLWRpZWdvLTIwMTItcG93ZXJzaGVsbC1kZWVwLWRpdmUtc2xpZGVzLWFuZC1kZW1vcy8mYW1wO2ltYWdldXJsPQ==" title=\"Post to Google Buzz\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/gbuzz/tt-gbuzz.png" alt="Post to Google Buzz" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3BpbmcuZm0vcmVmLz9tZXRob2Q9bWljcm9ibG9nJmFtcDt0aXRsZT1TYW4rRGllZ28rMjAxMitQb3dlclNoZWxsK0RlZXArRGl2ZStTbGlkZXMrYW5kK0RlbW9zJmFtcDtsaW5rPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3Nhbi1kaWVnby0yMDEyLXBvd2Vyc2hlbGwtZGVlcC1kaXZlLXNsaWRlcy1hbmQtZGVtb3Mv" title=\"Post to Ping.fm\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/ping/tt-ping.png" alt="Post to Ping.fm" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JlZGRpdC5jb20vc3VibWl0P3VybD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9zYW4tZGllZ28tMjAxMi1wb3dlcnNoZWxsLWRlZXAtZGl2ZS1zbGlkZXMtYW5kLWRlbW9zLyZhbXA7dGl0bGU9U2FuK0RpZWdvKzIwMTIrUG93ZXJTaGVsbCtEZWVwK0RpdmUrU2xpZGVzK2FuZCtEZW1vcw==" title=\"Post to Reddit\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/reddit/tt-reddit.png" alt="Post to Reddit" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NsYXNoZG90Lm9yZy9ib29rbWFyay5wbD91cmw9aHR0cDovL2pkaGl0c29sdXRpb25zLmNvbS9ibG9nLzIwMTIvMDUvc2FuLWRpZWdvLTIwMTItcG93ZXJzaGVsbC1kZWVwLWRpdmUtc2xpZGVzLWFuZC1kZW1vcy8mYW1wO3RpdGxlPVNhbitEaWVnbysyMDEyK1Bvd2VyU2hlbGwrRGVlcCtEaXZlK1NsaWRlcythbmQrRGVtb3M=" title=\"Post to Slashdot\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/slashdot/tt-slashdot.png" alt="Post to Slashdot" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dW1ibGV1cG9uLmNvbS9zdWJtaXQ/dXJsPWh0dHA6Ly9qZGhpdHNvbHV0aW9ucy5jb20vYmxvZy8yMDEyLzA1L3Nhbi1kaWVnby0yMDEyLXBvd2Vyc2hlbGwtZGVlcC1kaXZlLXNsaWRlcy1hbmQtZGVtb3MvJmFtcDt0aXRsZT1TYW4rRGllZ28rMjAxMitQb3dlclNoZWxsK0RlZXArRGl2ZStTbGlkZXMrYW5kK0RlbW9z" title=\"Post to StumbleUpon\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/su/tt-su.png" alt="Post to StumbleUpon" /></a> <a target=\"_blank\" class=\"tt\" href="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2hub3JhdGkuY29tL2ZhdmVzP2FkZD1odHRwOi8vamRoaXRzb2x1dGlvbnMuY29tL2Jsb2cvMjAxMi8wNS9zYW4tZGllZ28tMjAxMi1wb3dlcnNoZWxsLWRlZXAtZGl2ZS1zbGlkZXMtYW5kLWRlbW9zLw==" title=\"Post to Technorati\"><img class="nothumb" src="http://jdhitsolutions.com/blog/wp-content/plugins/tweet-this/icons/en/technorati/tt-technorati.png" alt="Post to Technorati" /></a></p></div> <img src="http://jdhitsolutions.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2273" width="1" height="1" style="display: none;" />
<p><a href="http://feedads.g.doubleclick.net/~a/zQy67ZkIqVXsEcoE8KMtKEWVdBk/0/da"><img src="http://feedads.g.doubleclick.net/~a/zQy67ZkIqVXsEcoE8KMtKEWVdBk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/zQy67ZkIqVXsEcoE8KMtKEWVdBk/1/da"><img src="http://feedads.g.doubleclick.net/~a/zQy67ZkIqVXsEcoE8KMtKEWVdBk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/78lbqF9MLc8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jdhitsolutions.com/blog/2012/05/san-diego-2012-powershell-deep-dive-slides-and-demos/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://jdhitsolutions.com/blog/2012/05/san-diego-2012-powershell-deep-dive-slides-and-demos/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=san-diego-2012-powershell-deep-dive-slides-and-demos</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 6.361 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-29 23:14:08 -->

