<?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>Office Monkey &#187; computers</title>
	<atom:link href="http://www.office-monkey.com/tag/computers/feed/?http://www.office-monkey.com:80/office-monkey/tag/computers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.office-monkey.com</link>
	<description>Everybody needs some monkey sometime...</description>
	<lastBuildDate>Sat, 30 Jul 2011 05:14:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Powershell Powers, Activate!</title>
		<link>http://www.office-monkey.com/2009/01/16/powershell-powers-activate/</link>
		<comments>http://www.office-monkey.com/2009/01/16/powershell-powers-activate/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 23:33:25 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Living]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.office-monkey.com/?p=542</guid>
		<description><![CDATA[Yesterday, I had a problem to solve. I didn&#8217;t want to stay at work until 9pm, waiting for another team&#8217;s process to publish a file. (Grossly simplified, but you get the idea). I also didn&#8217;t want to log in from home at 9pm in order to wait for it to happen (I did that the [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I had a problem to solve. I didn&#8217;t want to stay at work until 9pm, waiting for another team&#8217;s process to publish a file. (Grossly simplified, but you get the idea). I also didn&#8217;t want to log in from home at 9pm in order to wait for it to happen (I did that the night before).</p>
<p>So I used Powershell! Could I have used a batch file? Of course! However, I know with Powershell I can just chain commands together via a semi-colon.<br />
I <a href="http://www.live.com">searched</a> for &#8220;Powershell sleep&#8221;, and saw immediately that there was, in fact, a Powershell sleep command: start-sleep.</p>
<p>My final commandline:<br />
start-sleep -s 7000 ; GetFileCommand ; msbuild /t:clean,build</p>
<p>And I could just walk away, knowing it would be waiting for me when I got into today.</p>
<p>(That didn&#8217;t happen, but it was unrelated to the Powershell issue.)</p>
<p>However, that wasn&#8217;t my only use of Powershell yesterday. The MSBuild Project system defines a build through a series of linked .XML files. I uncovered an issue where a particular task wasn&#8217;t being completed as I expected. I could, through the wonders of &#8220;Find&#8221;, locate where I EXPECTED the work to be taking place, but in a 10,000+ line XML file, scrolling upward to find the parent is not entirely pleasant.</p>
<p>So I used code.</p>
<p>I read the XML into an XML object, then found the tag I was looking for. I then got an XML Navigator object for where I was in the document, and walked back up the tree until I found something identifiable (it turned out I was screwed). All told, it took me less time to puzzle out (via get-member) how to do so under Powershell than it would have taken for me to write a real program, or to find it by hand.</p>
<p>Here&#8217;s the entirety of what I wrote:<br />
$xmldoc = [xml] [string]::join(&#8220;`n&#8221;, (gc -read 10kb Native.Build.targets))<br />
$xmldoc | get-member<br />
$xmldoc.GetElementsByTagName(&#8216;Internal_LinkOutputFile&#8217;)<br />
$xmldoc.GetElementsByTagName(&#8216;Internal_LinkOutputFile&#8217;) | get-member<br />
$xmldoc.GetElementsByTagName(&#8216;Internal_LinkOutputFile&#8217;).Item(0)<br />
$xmldoc.GetElementsByTagName(&#8216;Internal_LinkOutputFile&#8217;).Item(0) | get-member<br />
$nav = $xmldoc.GetElementsByTagName(&#8216;Internal_LinkOutputFile&#8217;).Item(0).CreateNavigator()<br />
$nav<br />
$nav | get-member<br />
$nav.MoveToParent()<br />
$nav<br />
$nav.MoveToParent()<br />
$nav</p>
<p>There was an awful lot of get-member calls, but I didn&#8217;t need to know ANYTHING else.</p>
<p>Yay Powershell!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.office-monkey.com/2009/01/16/powershell-powers-activate/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Since I&#8217;ve been home&#8230;</title>
		<link>http://www.office-monkey.com/2008/01/25/since-ive-been-home/</link>
		<comments>http://www.office-monkey.com/2008/01/25/since-ive-been-home/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 09:39:55 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Day-to-Day]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://www.office-monkey.com/2008/01/25/since-ive-been-home/</guid>
		<description><![CDATA[I&#8217;ve disassembled an errant tablet pc, diagnosed a failing harddrive, backed up mounds of data to clear off another hard drive, taught myself how to use the new BCD system, and setup a harddrive to install Vista onto the aforementioned tablet pc. The last would have been easy if it had had either: a) an [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve disassembled an errant tablet pc, diagnosed a failing harddrive, backed up mounds of data to clear off another hard drive, taught myself how to use the new BCD system, and setup a harddrive to install Vista onto the aforementioned tablet pc. The last would have been easy if it had had either: a) an optical drive, or b) support for booting from a USB device, or c) a floppy drive.</p>
<p>See why I don&#8217;t post much?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.office-monkey.com/2008/01/25/since-ive-been-home/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

