<?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>JSEDLAK &#187; PowerShell</title>
	<atom:link href="http://jsedlak.org/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://jsedlak.org</link>
	<description></description>
	<lastBuildDate>Wed, 01 Sep 2010 00:44:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PowerShell Script for Copying Libraries</title>
		<link>http://jsedlak.org/2009/02/09/powershell-script-for-copying-libraries/</link>
		<comments>http://jsedlak.org/2009/02/09/powershell-script-for-copying-libraries/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 16:16:52 +0000</pubDate>
		<dc:creator>John Sedlak</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[FGF]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://jsedlak.com/?p=165</guid>
		<description><![CDATA[Here is a nice little PowerShell script I have created for copying my FGF libraries to the projects that use them. I also hot-keyed the PowerShell window which makes distributing new FGF builds really easy. ?View Code HTML1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a nice little PowerShell script I have created for copying my FGF libraries to the projects that use them. I also hot-keyed the PowerShell window which makes distributing new FGF builds really easy.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p165code2'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1652"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
</pre></td><td class="code" id="p165code2"><pre class="html" style="font-family:monospace;">function fgfDist
{
    # An array of platforms that need to be copied
    $platforms = &quot;x86&quot;,&quot;Xbox 360&quot;,&quot;Zune&quot;
&nbsp;
    if($args.count -ne 0){
        $platforms = $args
    }
&nbsp;
    # An array of destinations for copying
    $destinations = &quot;M:\Code\Games\Galactic Defense\trunk\Libraries\&quot;,
                    &quot;M:\Code\AIR\trunk\Libraries\&quot;
&nbsp;
    $source = &quot;M:\Code\FGF\trunk\Bin\&quot;
    $sourceSuffix = &quot;\Debug&quot;
&nbsp;
    # Loop through all the destinations and all the platforms
    # For each platform, copy some files.
    foreach($destination in $destinations)
    {
        write-host &quot;Starting copy to&quot;$destination
        foreach($platform in $platforms)
        {
            $tempSource = $source + $platform + $sourceSuffix
            $tempDestination = $destination + $platform
&nbsp;
            # Test if the folder exists
            if( Test-Path $tempSource ){
                if( !(Test-Path $tempDestination) ){
                    write-host &quot;Creating directory.&quot;
                    new-item -path $destination -name $platform -type directory
                }
            }
            else{
                write-host &quot;Could not find the source files for&quot;$platform
                continue
            }
&nbsp;
            # Get a list of DLL files that contains thrust as well as the FocusedGames.dll file.
            $thrustLibs = get-childItem $tempSource -force | ? {$_.extension -eq &quot;.dll&quot;}|where {$_.name -match &quot;Thrust&quot;}
            $coreLibs = get-childItem $tempSource -force | ? {$_.extension -eq &quot;.dll&quot;}|where {$_.name -match &quot;FocusedGames\.dll&quot;}
&nbsp;
            if($thrustLibs){
                foreach($dll in $thrustLibs){
                    if( $dll -ne &quot;&quot;){
                        copy-item $tempSource\$dll $tempDestination
                        write-host &quot;  Copied&quot;$platform\$dll
                    }
                }
            }
&nbsp;
            if($coreLibs){
                foreach($dll in $coreLibs){
                    if( $dll -ne &quot;&quot;){
                        copy-item $tempSource\$dll $tempDestination
                        write-host &quot;  Copied&quot;$platform\$dll
                    }
                }
            }
        }
    }
}</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://jsedlak.org/2009/02/09/powershell-script-for-copying-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Introduction to PowerShell</title>
		<link>http://jsedlak.org/2008/10/15/my-introduction-to-powershell/</link>
		<comments>http://jsedlak.org/2008/10/15/my-introduction-to-powershell/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 05:48:33 +0000</pubDate>
		<dc:creator>John Sedlak</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://jsedlak.com/?p=110</guid>
		<description><![CDATA[Wow! I can&#8217;t believe I have been missing this for so long. It is the answer to all my command line woes in Windows. I have only touched the surface but love it already. Today I created my profile to change the prompt and add a command for copying my FGF binaries to my current [...]]]></description>
			<content:encoded><![CDATA[<p>Wow! I can&#8217;t believe I have been missing this for so long. It is the answer to all my command line woes in Windows. I have only touched the surface but love it already. Today I created my profile to change the prompt and add a command for copying my FGF binaries to my current working directories:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p110code4'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1104"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
</pre></td><td class="code" id="p110code4"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080;"># Profile PowerShell Script</span>
<span style="color: #008080;"># Author: John Sedlak</span>
<span style="color: #008080;"># Site: http://focusedgames.com</span>
&nbsp;
$a <span style="color: #008000;">=</span> <span style="color: #008000;">&#40;</span>Get<span style="color: #008000;">-</span>Host<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">UI</span><span style="color: #008000;">.</span><span style="color: #0000FF;">RawUI</span>
$a<span style="color: #008000;">.</span><span style="color: #0000FF;">ForegroundColor</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;White&quot;</span>
$a<span style="color: #008000;">.</span><span style="color: #0000FF;">WindowTitle</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;WPS - Focused Games&quot;</span>
&nbsp;
<span style="color: #008080;"># This function changes the prompt.</span>
function prompt<span style="color: #008000;">&#123;</span>
	$path <span style="color: #008000;">=</span> get<span style="color: #008000;">-</span>location
	$b <span style="color: #008000;">=</span> Get<span style="color: #008000;">-</span>Date <span style="color: #008000;">-</span>format <span style="color: #666666;">&quot;HH:mm&quot;</span>
	<span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #666666;">&quot;$b $path ?&gt; &quot;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #008080;"># This function copies a bunch of FGF libraries to current working directories.</span>
function fgfCopy<span style="color: #008000;">&#123;</span>
	<span style="color: #008080;"># These are the platforms that need to be copied</span>
	$platforms <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;x86&quot;</span>,<span style="color: #666666;">&quot;Zune&quot;</span>,<span style="color: #666666;">&quot;Xbox 360&quot;</span>
&nbsp;
	<span style="color: #008080;"># An array of the destinations for copying</span>
	$destinations <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;E:<span style="color: #008080; font-weight: bold;">\U</span>sers<span style="color: #008080; font-weight: bold;">\J</span>ohn Sedlak<span style="color: #008080; font-weight: bold;">\C</span>ode<span style="color: #008080; font-weight: bold;">\G</span>ames<span style="color: #008080; font-weight: bold;">\G</span>W3<span style="color: #008080; font-weight: bold;">\t</span>runk<span style="color: #008080; font-weight: bold;">\L</span>ibraries<span style="color: #008080; font-weight: bold;">\&quot;</span>
&nbsp;
	# The source directory and the suffix.
	$source = &quot;</span>E<span style="color: #008000;">:</span>\Users\John Sedlak\Code\FGF\trunk\Bin\<span style="color: #666666;">&quot;
	$sourceSuffix = &quot;</span>\Release<span style="color: #666666;">&quot;
&nbsp;
	# Loop through all the destinations and all the platforms
	# For each platform, copy some files.
	foreach($destination in $destinations){
		write-host &quot;</span>Starting copy to<span style="color: #666666;">&quot;$destination
		foreach($platform in $platforms){
			# Build up the source and destination paths
			$tempSource = $source + $platform + $sourceSuffix
			$tempDestination = $destination + $platform
&nbsp;
			# Get a list of all DLL files that contain the word Thrust
			$files = get-childItem $tempSource -force | ? {$_.extension -eq &quot;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">dll</span><span style="color: #666666;">&quot;}|where {$_.name -match &quot;</span>Thrust<span style="color: #666666;">&quot;}
&nbsp;
			# For each file, copy it!
			foreach($dll in $files){
				copy-item $tempSource<span style="color: #008080; font-weight: bold;">\$</span>dll $tempDestination
				write-host &quot;</span>Copied<span style="color: #666666;">&quot;$platform<span style="color: #008080; font-weight: bold;">\$</span>dll
			}
		}
	}
}</span></pre></td></tr></table></div>

<div style="text-align:center;"><a href='http://jsedlak.com/wp-content/uploads/2008/10/wps01.png'><img src="http://jsedlak.com/wp-content/uploads/2008/10/wps01-300x219.png" alt="PowerShell - fgfCopy Command" title="PowerShell - fgfCopy Command" width="300" height="219" class="alignnone size-medium wp-image-111" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://jsedlak.org/2008/10/15/my-introduction-to-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
