<?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>TheUndeadable entwickelt &#187; Powershell</title>
	<atom:link href="http://blog.depon.net/index.php/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.depon.net</link>
	<description>Ein Ausschnitt aus dem Leben</description>
	<lastBuildDate>Fri, 03 Feb 2012 18:11:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Wenn Lotus Notes h&#228;ngt</title>
		<link>http://blog.depon.net/index.php/2011/09/22/wenn-lotus-notes-hngt/</link>
		<comments>http://blog.depon.net/index.php/2011/09/22/wenn-lotus-notes-hngt/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 18:43:48 +0000</pubDate>
		<dc:creator>TheUndeadable</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Windows ME]]></category>

		<guid isPermaLink="false">http://blog.depon.net/index.php/2011/09/22/wenn-lotus-notes-hngt/</guid>
		<description><![CDATA[Wenn Lotus Notes mal wieder völlig unerwartet hängt, so soll man laut fluchen und folgenden Befehl in der Powershell als Administrator ausführen: Get-Process &#124; ? { $_.ProcessName.Contains(&#34;notes&#34;) } &#124; Kill Dann ist man nicht nur Lotus Notes los, sondern auch all seine unsäglichen Hilfsprozesse, die bei einem normalen Abschuss informieren und tolle Logs schreiben, aber [...]]]></description>
			<content:encoded><![CDATA[<p>Wenn Lotus Notes mal wieder völlig unerwartet hängt, so soll man laut fluchen und folgenden Befehl in der Powershell als Administrator ausführen: </p>
<blockquote><p>Get-Process | ? { $_.ProcessName.Contains(&quot;notes&quot;) } | Kill</p>
</blockquote>
<p>Dann ist man nicht nur Lotus Notes los, sondern auch all seine unsäglichen Hilfsprozesse, die bei einem normalen Abschuss informieren und tolle Logs schreiben, aber nicht helfen. </p>
<p>Lotus Notes… Du gehörst in die Mülltonne in der auch Windows ME gelandet ist! </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.depon.net/index.php/2011/09/22/wenn-lotus-notes-hngt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Status des Repositories im Prompt</title>
		<link>http://blog.depon.net/index.php/2010/04/02/status-des-repositories-im-prompt/</link>
		<comments>http://blog.depon.net/index.php/2010/04/02/status-des-repositories-im-prompt/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 08:51:40 +0000</pubDate>
		<dc:creator>TheUndeadable</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://blog.depon.net/index.php/2010/04/02/status-des-repositories-im-prompt/</guid>
		<description><![CDATA[Wie langweilig ist schon c:\Projekte\FBK&#62; im Prompt zu haben? Ein Microsoft-Mitarbeiter hat ein kleines Powershell-Skript veröffentlicht, dass den aktuellen Status des Repositories im Prompt anzeigt: hg b:default c:1 modified, 1 unknown&#62; Eine sehr nette Idee!]]></description>
			<content:encoded><![CDATA[<p>Wie langweilig ist schon c:\Projekte\FBK&gt; im Prompt zu haben? </p>
<p><a href="http://blogs.msdn.com/matt/archive/2010/04/01/a-mercurial-powershell-prompt.aspx ">Ein Microsoft-Mitarbeiter hat ein kleines Powershell-Skript veröffentlicht</a>, dass den aktuellen Status des Repositories im Prompt anzeigt:</p>
<blockquote><p>hg b:default c:1 modified, 1 unknown&gt; </p>
</blockquote>
<p>Eine sehr nette Idee!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.depon.net/index.php/2010/04/02/status-des-repositories-im-prompt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kompilieren, Verpacken und Hochladen</title>
		<link>http://blog.depon.net/index.php/2010/03/29/kompilieren-verpacken-und-hochladen/</link>
		<comments>http://blog.depon.net/index.php/2010/03/29/kompilieren-verpacken-und-hochladen/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 20:49:02 +0000</pubDate>
		<dc:creator>TheUndeadable</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[Another Spacegame]]></category>
		<category><![CDATA[fbk]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://blog.depon.net/index.php/2010/03/29/kompilieren-verpacken-und-hochladen/</guid>
		<description><![CDATA[Mit Hilfe folgenden PowerShell-Skriptes kann ich nun den FBK kompilieren, verpacken und auf den Webspace hochladen. Leider gibt es in PowerShell keine funktionierende ZIP-Klasse, so dass ich hier auf 7-Zip zurückgreife: msbuild FBK.sln /property:Configuration=Release Remove-Item Deliverable -Force -Recurse New-Item -type directory -f Deliverable Copy-Item -Recurse FBK/src/bin/Release/ Deliverable/ &#38; &#8216;C:/Program Files/7-Zip/7z.exe&#8217; a Deliverable/Release.zip ./Deliverable/Release/ Write-Host &#34;Benutzername: [...]]]></description>
			<content:encoded><![CDATA[<p>Mit Hilfe folgenden PowerShell-Skriptes kann ich nun den FBK kompilieren, verpacken und auf den Webspace hochladen. Leider gibt es in PowerShell keine funktionierende ZIP-Klasse, so dass ich hier auf 7-Zip zurückgreife:</p>
<blockquote><p>msbuild FBK.sln /property:Configuration=Release </p>
<p>Remove-Item Deliverable -Force -Recurse     <br />New-Item -type directory -f Deliverable </p>
<p>Copy-Item -Recurse FBK/src/bin/Release/ Deliverable/ </p>
<p>&amp; &#8216;C:/Program Files/7-Zip/7z.exe&#8217; a Deliverable/Release.zip ./Deliverable/Release/     </p>
<p>Write-Host &quot;Benutzername: &quot; -NoNewline      <br />$user = Read-Host      <br />Write-Host &quot;Kennwort: &quot; -NoNewline      <br />$password = Read-Host      <br />$currentDirectory = (Get-Item .).ToString()      <br />$File = &quot;$currentDirectory/Deliverable/Release.zip&quot;       <br />$ftp = &quot;<a href="ftp://depon.net/htdocs/www.depon.net/downloads/fbk.zip&quot;">ftp://depon.net/htdocs/www.depon.net/downloads/fbk.zip&quot;</a>      <br />$webclient = New-Object System.Net.WebClient       <br />$webclient.Credentials = New-Object System.Net.NetworkCredential($user,$password) </p>
<p>$uri = New-Object System.Uri($ftp)      <br />&quot;Uploading $File&#8230;&quot;       <br />$webclient.UploadFile($uri, $File) </p>
</blockquote>
<p>Das Skript besteht im Prinzip aus vier Teilen: </p>
<ol>
<li>Mit Hilfe von msbuild wird die VisualStudio-Solution als Release kompiliert. </li>
<li>Danach finden ein paar Umkopieraktionen statt</li>
<li>Über das Kommandozeilen-Interface von 7-Zip wird das Release-Verzeichnis gezippt. Im späteren Schritt werde ich vermutlich auf die Ionic-Zip-Library zurückgreifen. </li>
<li>Nach Abfrage der Kenndaten wird mit Hilfe der WebClient-Klasse das Zip auf den FTP-Webserver hochgeladen. Hier ist es auch schade, dass es kein PowerShell-Skript für den FTP-Upload gibt.</li>
</ol>
<p>Mit einem Server-‘Gegenskript’ werde ich in Zukunft eine bestehende FBK-Instanz beenden, das ZIP-Archiv herunterladen, entpacken, an die richtige Stelle legen und das Spiel starten. Damit lassen sich die Deployment-Zeiten auf ein minimales Reduzieren. </p>
<p><a href="http://blog.depon.net/uploads/KompilierenVerpackenundHochladen_1405B/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blog.depon.net/uploads/KompilierenVerpackenundHochladen_1405B/image_thumb.png" width="604" height="477" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.depon.net/index.php/2010/03/29/kompilieren-verpacken-und-hochladen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Aktuelle Changeset-ID eines hg-Repository herausfinden</title>
		<link>http://blog.depon.net/index.php/2010/01/17/aktuelle-changeset-id-eines-hg-repository-herausfinden/</link>
		<comments>http://blog.depon.net/index.php/2010/01/17/aktuelle-changeset-id-eines-hg-repository-herausfinden/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 21:07:36 +0000</pubDate>
		<dc:creator>TheUndeadable</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://blog.depon.net/index.php/2010/01/17/aktuelle-changeset-id-eines-hg-repository-herausfinden/</guid>
		<description><![CDATA[In Powershell: Get-ChangeSetId.ps1: if ( $args.Count -eq 0 ) { &#160;&#160;&#160; Write-Host ( &#34;No Repository given&#34; ); } else { &#160;&#160;&#160; $repos = $args[0]; &#160;&#160;&#160; hg -R &#34;$repos&#34; &#8211;debug tags &#124; Select-String &#34;tip&#34; &#124; % { $_ -match &#34;:(.[0-9a-f])*&#34; } &#124; % { $Matches[0].Substring(1) } } Benutzung: Get-ChangeSetId src\BurnSystems Und um eine neue .hgsubstate-Datei aufzubauen: [...]]]></description>
			<content:encoded><![CDATA[<p>In Powershell:</p>
<blockquote><p><strong>Get-ChangeSetId.ps1:</strong></p>
</blockquote>
<blockquote><p>if ( $args.Count -eq 0 )      <br />{       <br />&#160;&#160;&#160; Write-Host ( &quot;No Repository given&quot; );       <br />}       <br />else       <br />{       <br />&#160;&#160;&#160; $repos = $args[0];       <br />&#160;&#160;&#160; hg -R &quot;$repos&quot; &#8211;debug tags | Select-String &quot;tip&quot; | % { $_ -match &quot;:(.[0-9a-f])*&quot; } | % { $Matches[0].Substring(1) }       <br />}</p>
</blockquote>
<p>Benutzung:</p>
<blockquote><p>Get-ChangeSetId src\BurnSystems</p>
</blockquote>
<p>Und um eine neue .hgsubstate-Datei aufzubauen:</p>
<blockquote><p>dir * | % { &quot;{1} src\{0}&quot; -f $_.Name, (.\getchangesetid.ps1 $_) }</p>
</blockquote>
<p>Das Resultat sollte dann einfach nachbearbeitet werden:</p>
<p><a href="http://blog.depon.net/uploads/AktuelleChangesetIDherausfinden_136DF/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blog.depon.net/uploads/AktuelleChangesetIDherausfinden_136DF/image_thumb.png" width="604" height="210" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.depon.net/index.php/2010/01/17/aktuelle-changeset-id-eines-hg-repository-herausfinden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Die Powershell in der eigenen Konsolenapplikation</title>
		<link>http://blog.depon.net/index.php/2010/01/04/die-powershell-in-der-eigenen-konsolenapplikation/</link>
		<comments>http://blog.depon.net/index.php/2010/01/04/die-powershell-in-der-eigenen-konsolenapplikation/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 22:37:24 +0000</pubDate>
		<dc:creator>TheUndeadable</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fbk]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://blog.depon.net/index.php/2010/01/04/die-powershell-in-der-eigenen-konsolenapplikation/</guid>
		<description><![CDATA[Auch genannt: An embedded powershell in a console application. Dazu benötigt man im Prinzip nur zwei Schritte: Microsoft.PowerShell.ConsoleHost und System.Management.Automation als Verweis hinzufügen. Folgenden Quelltext in der einfügen. // Create Powershell&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ConsoleShell.Start( &#160;&#160;&#160; RunspaceConfiguration.Create(), &#160;&#160;&#160; &#34;Welcome to FBK-Shell&#34;, &#160;&#160;&#160; string.Empty, &#160;&#160;&#160; new string[] { }); Bei Ausführung dieses Befehles übernimmt die Powershell die Kontrolle über [...]]]></description>
			<content:encoded><![CDATA[<p>Auch genannt: An embedded powershell in a console application. </p>
<p>Dazu benötigt man im Prinzip nur zwei Schritte: </p>
<ol>
<li>Microsoft.PowerShell.ConsoleHost und System.Management.Automation als Verweis hinzufügen. </li>
<li>Folgenden Quelltext in der einfügen.</li>
</ol>
<blockquote><p>// Create Powershell&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />ConsoleShell.Start(      <br />&#160;&#160;&#160; RunspaceConfiguration.Create(),       <br />&#160;&#160;&#160; &quot;Welcome to FBK-Shell&quot;,       <br />&#160;&#160;&#160; string.Empty,       <br />&#160;&#160;&#160; new string[] { });</p>
</blockquote>
<p>Bei Ausführung dieses Befehles übernimmt die Powershell die Kontrolle über die Konsole: </p>
<p><a href="http://blog.depon.net/uploads/DiePowershellindereigenenKonsolenapplika_14C1D/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blog.depon.net/uploads/DiePowershellindereigenenKonsolenapplika_14C1D/image_thumb.png" width="604" height="307" /></a> </p>
<p>Mit Hilfe des Powershell-Befehles </p>
<blockquote><p>$game = [BurnSystems.FBK.App.ConsoleProgram]::Game</p>
</blockquote>
<p>holt man sich das Spiel-Objekt. </p>
<p>Damit kann man nun direkt auf die Spielobjekte zugreifen:</p>
<blockquote><p>PS&gt; $game.DataStorage[&quot;world&quot;].WorldData.Players | Select-Object {$_.Playername, $_.Towns[0].Resources.Available</p>
<p>{TEST2, Metal=3520, Crystal=3610, Fuel=3600, Energy=15, Fields=100, Construc&#8230;     <br />{Undead, Metal=3605, Crystal=3602,5, Fuel=3600, Energy=15, Fields=100, Const&#8230;</p>
</blockquote>
<p>Oder gar die Objekte manipulieren</p>
<p><a href="http://blog.depon.net/uploads/DiePowershellindereigenenKonsolenapplika_14C1D/image_3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blog.depon.net/uploads/DiePowershellindereigenenKonsolenapplika_14C1D/image_thumb_3.png" width="604" height="307" /></a> </p>
<p>Damit ist es nun für einen Spielbetreiber sehr einfach möglich Powershell-Skripte zu schreiben mit dessen Hilfe man direkt auf die FBK-Datenbank zugreifen kann. In den nächsten Wochen werde ich mich in dem Thema vertiefen, so dass man mit der PowerShell einfacher auf die Datenbank und der Logik zugreifen kann. </p>
<p>Als Beispiel schwebt mir folgendes Kommando vor:</p>
<blockquote><p>$logic.GetLogic(“TradingPlatform”).GetAuctions() | % { $_.Cancel(); } </p>
</blockquote>
<p>Dies ist prinzipiell jetzt schon mit folgenden Befehlen möglich: </p>
<blockquote><p># Initialisierung     <br />$game = [BurnSystems.FBK.App.ConsoleProgram]::Game      <br />$session = $game.LogicCore.CreateSession();      <br />$auctionLogicType = [BurnSystems.FBK.Plugins.TradingPlatform.ITradingPlatformLogic]      <br />$auction = $game.LogicCore.CreateLogicHandler($auctionLogicType)      <br />$auction.LogicSession = $session; </p>
<p># Anzeige aller Auktionen      <br />$auction.GetAuctions() | % { $_.Data } | Format-Table </p>
<p># Abbruch der Auktionen     <br />$auction.GetAuctions() | % { $_.Cancel(); } </p>
<p>$auction.GetAuctions().Count</p>
</blockquote>
<p>In der Shell sieht es folgendermaßen aus: </p>
<p><a href="http://blog.depon.net/uploads/DiePowershellindereigenenKonsolenapplika_14C1D/image_4.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blog.depon.net/uploads/DiePowershellindereigenenKonsolenapplika_14C1D/image_thumb_4.png" width="562" height="484" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.depon.net/index.php/2010/01/04/die-powershell-in-der-eigenen-konsolenapplikation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

