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

<channel>
	<title>Huddled Masses &#187; WMI</title>
	<atom:link href="http://huddledmasses.org/tag/wmi/feed/" rel="self" type="application/rss+xml" />
	<link>http://huddledmasses.org</link>
	<description>You can do more than breathe for free...</description>
	<lastBuildDate>Sat, 28 Jan 2012 21:37:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<cloud domain='huddledmasses.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>AutoMount Removable Drives in PowerShell v2 (CTP2)</title>
		<link>http://huddledmasses.org/automount-removable-drives-in-powershell-v2-ctp2/</link>
		<comments>http://huddledmasses.org/automount-removable-drives-in-powershell-v2-ctp2/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 04:12:24 +0000</pubDate>
		<dc:creator>Joel 'Jaykul' Bennett</dc:creator>
				<category><![CDATA[Huddled]]></category>
		<category><![CDATA[EventHandler]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[ManagementEventWatcher]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Removable]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://HuddledMasses.org/?p=637</guid>
		<description><![CDATA[Oisin (x0n) Grehan wrote a module for PowerShell 2 which uses the WMI ManagementEventWatcher and the new event-handling features of PowerShell 2.0 to automatically run scripts whenever you plug in or unplug a removable drive &#8230;. specifically, the AutoMount module runs New-PSDrive whenever you plug in a removable, and Remove-PSDrive when you unplug it. The [...]]]></description>
			<content:encoded><![CDATA[	<p>Oisin (x0n) Grehan wrote a module for PowerShell 2 which uses the <span class="caps">WMI</span> ManagementEventWatcher and  the new event-handling features of PowerShell 2.0 to automatically run scripts whenever you plug in or unplug a removable drive &#8230;. specifically, the <a href="http://www.nivot.org/2008/08/16/AutoMountunmountNewPSDrivesForRemovableDrivesAndNetworkSharesInPowerShellV2.aspx">AutoMount module</a> runs <code>New-PSDrive</code> whenever you plug in a removable, and <code>Remove-PSDrive</code> when you unplug it.</p>

	<p>The bottom line is it works great (at least on Vista), and I think I&#8217;ll add it to my &#8220;AutoModules&#8221;  <img src='http://huddledmasses.org/wordpress/wp-includes/' alt=';)' class='wp-smiley' />  ... <del>sadly, it&#8217;s not on <a href="http://PoshCode.org/">PoshCode</a> yet :</del>/ but you should go- check it out, it&#8217;s a great example of how to work with events in PowerShell, both consuming and creating them (incidentally, x0n&#8217;s <a href="http://www.codeplex.com/PSEventing">PSEventing</a> snapin would let you accomplish this in PowerShell v1).   <img src='http://huddledmasses.org/wordpress/wp-includes/' alt='[new]' class='wp-smiley' />   x0n&#8217;s posted it on PoshCode, so you can <code>Get-PoshCode 525</code> if you have <a href="http://PoshCode.org/PoshCode.psm1">the module</a> or <a href="http://PoshCode.org/PoshCode.ps1">script</a> installed, or download it from the embed link below:</p>

	<p><script src="http://PoshCode.org/embed/525"></script></p>]]></content:encoded>
			<wfw:commentRss>http://huddledmasses.org/automount-removable-drives-in-powershell-v2-ctp2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

