<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>PowerShell Eventing QuickStart</title><link>http://blogs.msdn.com/powershell/archive/2008/06/11/powershell-eventing-quickstart.aspx</link><description>The second CTP of PowerShell V2 (CTP2) introduces another new feature called PowerShell Eventing. PowerShell Eventing lets you respond to the asynchronous notifications that many objects support. We didn’t get a chance to fully document these cmdlets</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Dew Drop &amp;ndash; June 11, 2008 | Alvin Ashcraft's Morning Dew</title><link>http://blogs.msdn.com/powershell/archive/2008/06/11/powershell-eventing-quickstart.aspx#8591246</link><pubDate>Wed, 11 Jun 2008 15:37:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8591246</guid><dc:creator>Dew Drop &amp;ndash; June 11, 2008 | Alvin Ashcraft's Morning Dew</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.alvinashcraft.com/2008/06/11/dew-drop-june-11-2008/"&gt;http://www.alvinashcraft.com/2008/06/11/dew-drop-june-11-2008/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: PowerShell Eventing QuickStart</title><link>http://blogs.msdn.com/powershell/archive/2008/06/11/powershell-eventing-quickstart.aspx#8592102</link><pubDate>Wed, 11 Jun 2008 23:27:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8592102</guid><dc:creator>Jon</dc:creator><description>&lt;p&gt;Some very powerful techniques in there. Thanks.&lt;/p&gt;
&lt;p&gt;I noticed that the history preservation works if you type 'exit', but not if you click the top-right X to close Powershell. Is it possible to do something similar to intercept that event too, or would that be a different kettle of fish?&lt;/p&gt;
&lt;p&gt;Jon&lt;/p&gt;</description></item><item><title>re: PowerShell Eventing QuickStart</title><link>http://blogs.msdn.com/powershell/archive/2008/06/11/powershell-eventing-quickstart.aspx#8710231</link><pubDate>Wed, 09 Jul 2008 02:14:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8710231</guid><dc:creator>shaurav</dc:creator><description>&lt;p&gt;i tried following your post. For some reason, Register-ObjectEvent throws an error saying that it not recognized as a cmdlet, function, etc. etc.&lt;/p&gt;
&lt;p&gt;is there any extra library/snap-in that i need before i could use this cmdlet?&lt;/p&gt;
&lt;p&gt;Please help me.&lt;/p&gt;</description></item><item><title>re: PowerShell Eventing QuickStart</title><link>http://blogs.msdn.com/powershell/archive/2008/06/11/powershell-eventing-quickstart.aspx#8762826</link><pubDate>Tue, 22 Jul 2008 03:27:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8762826</guid><dc:creator>PowerShellTeam</dc:creator><description>&lt;p&gt;Hi Shaurav;&lt;/p&gt;
&lt;p&gt;This requires CTP2 of PowerShell.&lt;/p&gt;
</description></item><item><title>re: PowerShell Eventing QuickStart TFS</title><link>http://blogs.msdn.com/powershell/archive/2008/06/11/powershell-eventing-quickstart.aspx#8767394</link><pubDate>Wed, 23 Jul 2008 20:30:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8767394</guid><dc:creator>shaurav</dc:creator><description>&lt;p&gt;Thank you. I was not aware of the new CTP. I hvae another question, is it possible to register TFS events using what you wrote above? i want to create a script which kicks off a build as soon as a developer checks-in some code. &lt;/p&gt;</description></item><item><title>re: PowerShell Eventing QuickStart</title><link>http://blogs.msdn.com/powershell/archive/2008/06/11/powershell-eventing-quickstart.aspx#8767715</link><pubDate>Thu, 24 Jul 2008 00:11:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8767715</guid><dc:creator>PowerShellTeam</dc:creator><description>&lt;p&gt;from James Manning on the TFS team:&lt;/p&gt;
&lt;p&gt;Short answer:&lt;/p&gt;
&lt;p&gt;what you're asking for is &amp;quot;continuous integration&amp;quot; and it's built-in to TFS 2008 and there are multiple ways of doing it with TFS 2005. &amp;nbsp;I would imagine you'll be able to leverage existing work for this.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/buckh/archive/2006/08/09/more-continuous-integration.aspx"&gt;http://blogs.msdn.com/buckh/archive/2006/08/09/more-continuous-integration.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Long answer:&lt;/p&gt;
&lt;p&gt;TFS &amp;quot;events&amp;quot; (a bad choice on our part to overload that term) aren't .NET events, they're just notification mechanisms initiated by the TFS server (send email or call web service).&lt;/p&gt;
&lt;p&gt;For your case, the simplest thing would probably be a powershell script that hosted a web service (using WCF or whatever), register it on the TFS server (BisSubscribe.exe or some other tool for managing the subscriptions) then when the service gets called for a checkin, kick off the build.&lt;/p&gt;
&lt;p&gt;However, as mentioned earlier, TFS 2008 already has this built-in, so I'd recommend upgrading to it (if you're still on 2005) and using the CI we already put in the box :)&lt;/p&gt;
</description></item><item><title>re: PowerShell Eventing QuickStart re Warning $args has changed</title><link>http://blogs.msdn.com/powershell/archive/2008/06/11/powershell-eventing-quickstart.aspx#9470985</link><pubDate>Thu, 12 Mar 2009 00:11:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9470985</guid><dc:creator>Bob Landau</dc:creator><description>&lt;p&gt;For those running CTP3 I thought I'd let you know how to update Lees's script &amp;quot;Event Forwarding/Supports Events&amp;quot;. Paul expained to me how to do this in the public discussion group. &lt;/p&gt;
&lt;p&gt;-&amp;gt; Enable-ProcessCreationEvent&lt;/p&gt;
&lt;p&gt;change &lt;/p&gt;
&lt;p&gt;$args[1].SourceEventArgs.NewEvent.TargetInstance&lt;/p&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;p&gt;$args[1].NewEvent.TargetInstance&lt;/p&gt;
&lt;p&gt;change &lt;/p&gt;
&lt;p&gt;-&amp;gt; Register-PsEvent &lt;/p&gt;
&lt;p&gt;to &lt;/p&gt;
&lt;p&gt;Register-EngineEvent&lt;/p&gt;
&lt;p&gt;in addition to this change the parameter&lt;/p&gt;
&lt;p&gt;$args[1].SourceArgs[0].Name.Split&lt;/p&gt;
&lt;p&gt;to &lt;/p&gt;
&lt;p&gt;$args[0].Name.Split&lt;/p&gt;
&lt;p&gt;one other note $args are scoped to the action block. &lt;/p&gt;
&lt;p&gt;In the case of RegisterObjectEvent these are ManagementEventWatcher and EventArrivedEventArgs respectively. &lt;/p&gt;
&lt;p&gt;In the example above case New-Event is returning a WMI query to Register-EngineEvent so this will be a ManagementBaseObject that encapsulates a WMI class. In this case the properties of Win32_Process.&lt;/p&gt;
&lt;p&gt;Hopefully this will save some of you time and frustration&lt;/p&gt;</description></item><item><title>multithreading PowerShell Eventing QuickStart</title><link>http://blogs.msdn.com/powershell/archive/2008/06/11/powershell-eventing-quickstart.aspx#9485583</link><pubDate>Wed, 18 Mar 2009 05:37:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9485583</guid><dc:creator>Yup</dc:creator><description>&lt;p&gt;Can we do multithreading using powershell?&lt;/p&gt;
&lt;p&gt;Like wise shooting some query strings to a set of database servers simultaneousl;y.&lt;/p&gt;</description></item><item><title>re: PowerShell Eventing QuickStart</title><link>http://blogs.msdn.com/powershell/archive/2008/06/11/powershell-eventing-quickstart.aspx#9829168</link><pubDate>Sat, 11 Jul 2009 02:22:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9829168</guid><dc:creator>Ric Lewis</dc:creator><description>&lt;p&gt;Another update--in the final version of Powershell v2, &amp;quot;PSEvent*&amp;quot; cmdlets have been renamed &amp;quot;Event*&amp;quot;&lt;/p&gt;</description></item><item><title>PowerShell events from COM objects</title><link>http://blogs.msdn.com/powershell/archive/2008/06/11/powershell-eventing-quickstart.aspx#9866659</link><pubDate>Wed, 12 Aug 2009 19:02:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9866659</guid><dc:creator>Jo</dc:creator><description>&lt;p&gt;Is it possible to handle&lt;/p&gt;
&lt;p&gt;events from COM objects?&lt;/p&gt;
&lt;p&gt;e.g.&lt;/p&gt;
&lt;p&gt;$comobj = New-Object -ComObject ...&lt;/p&gt;
&lt;p&gt;Following command doesn't show anything. Why? &lt;/p&gt;
&lt;p&gt;$comobj | Get-Member -Type Event &lt;/p&gt;
&lt;p&gt;The COM object has events. In VBScript I can receive events.&lt;/p&gt;</description></item><item><title>re: PowerShell Eventing QuickStart</title><link>http://blogs.msdn.com/powershell/archive/2008/06/11/powershell-eventing-quickstart.aspx#9883857</link><pubDate>Tue, 25 Aug 2009 19:47:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9883857</guid><dc:creator>Paul M. Parks</dc:creator><description>&lt;p&gt;@Jo: I'm looking for exactly the same thing, myself. I can do it from, say, C#, so it's possible, but I can't yet work out the Powershell voodoo necessary to do it.&lt;/p&gt;</description></item><item><title>re: PowerShell Eventing QuickStart</title><link>http://blogs.msdn.com/powershell/archive/2008/06/11/powershell-eventing-quickstart.aspx#9943046</link><pubDate>Sat, 02 Jan 2010 23:17:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9943046</guid><dc:creator>Andrew</dc:creator><description>&lt;p&gt;I have some troubles with event forwarding.&lt;/p&gt;
&lt;p&gt;Im using code like this:&lt;/p&gt;
&lt;p&gt;$remoteComputer = &amp;quot;some_comp&amp;quot;&lt;/p&gt;
&lt;p&gt;$session = New-PsSession $remoteComputer&lt;/p&gt;
&lt;p&gt;Unregister-Event CatchEvent -ErrorAction SilentlyContinue&lt;/p&gt;
&lt;p&gt;Invoke-Command $session {&lt;/p&gt;
&lt;p&gt;service&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;$query = @&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SELECT *&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FROM __instancecreationevent&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WHERE TargetInstance ISA 'Win32_NtLogEvent'&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;and targetinstance.eventcode = '7036'&lt;/p&gt;
&lt;p&gt;&amp;quot;@&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Register-WmiEvent -Query $query &amp;quot;CatchEvent&amp;quot; -Forward&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;$null = Register-EngineEvent CatchEvent -Action { $GLOBAL:MyEvent = $event}&lt;/p&gt;
&lt;p&gt;But $MyEvent.SourceEventArgs.SerializedRemoteEventA&lt;/p&gt;
&lt;p&gt;rgs.NewEvent.TargetInstance is string, not event.&lt;/p&gt;
&lt;p&gt;Tell me please, whats wrong with my script?&lt;/p&gt;</description></item></channel></rss>