<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Yannis Güdel]]></title><description><![CDATA[Blog about automation and software development.]]></description><link>http://blog-yannis.azurewebsites.net/</link><generator>Ghost v0.4.0</generator><lastBuildDate>Thu, 16 Apr 2026 20:28:35 GMT</lastBuildDate><atom:link href="http://blog-yannis.azurewebsites.net/rss/" rel="self" type="application/rss+xml"/><author><![CDATA[Yannis Güdel]]></author><ttl>60</ttl><item><title><![CDATA[MyOApp 2.0 mit integrierter Resultat-Ansicht]]></title><description><![CDATA[<p>Vor fast 2 Jahren erblickte MyOApp das Licht der App Stores. In den Tagen nach der Veröffentlichung gab es einige Updates um Fehler zu beheben. Auf neue Features warteten die User aber vergebens. Das Warten hat nun aber ein Ende. Der Wettkampfpause sei dank: MyOApp 2.0 ist da!</p>

<h1 id="wasistneu">Was ist neu?</h1>

<p>Die App wurde von Grund auf neu entwickelt, um die zukünftige Weiterentwicklung zu vereinfachen. Die Benutzeroberfläche jedoch ist sehr ähnlich geblieben. Auf der Startseite werden wahlweise alle vergangenen oder zukünftigen Wettkämpfe angezeigt. Die bedeutendste Neuigkeit ist die integrierte Resultat-Anischt. Die Ranglisten können nun direkt in der App angezeigt werden: <br />
<img src='http://blog-yannis.azurewebsites.net/content/images/2015/Nov/Simulator_Screen_Shot_06_Nov_2015_20_00_29.png'  alt="" />
Ebenfalls können in der App die Zwischenzeiten analysiert werden: <br />
<img src='http://blog-yannis.azurewebsites.net/content/images/2015/Nov/Simulator_Screen_Shot_06_Nov_2015_20_00_31.png'  alt="" /></p>

<h1 id="wasistverschwunden">Was ist verschwunden?</h1>

<p>Weggefallen ist in MyOApp die Funktion Wettkämpfe auf der Startseite zu verstecken. Ebenfalls gibt es keine Windows Phone app mehr.</p>

<h1 id="wieerhalteichdasupdate">Wie erhalte ich das Update?</h1>

<p>Falls du MyOApp bereits installiert hast, wird in den nächsten Stunden ein Update verfügbar sein. Falls du MyOApp noch nicht installiert hast, kannst du es im <a href='https://play.google.com/store/apps/details?id=com.monkeytech.myoapp.android' >Play Store</a> oder im <a href='https://itunes.apple.com/us/app/myoapp/id765324754?ls=1&amp;mt=8' >iTunes Store</a> herunterladen.</p>

<h1 id="credits">Credits</h1>

<p>Merci an Simon Räss an dieser Stelle für die Vorarbeiten!  </p>

<h1 id="zukunft">Zukunft</h1>

<p>Ideen für die Weiterentwicklung gibt es viele:</p>

<ul>
<li>Integrierte Startlisten</li>
<li>Benachrichtigungen wenn eine neue Rangliste publiziert wird</li>
<li>Filtern und Suche auf der Startseite</li>
<li>Internationalisierung der App indem auch Wettkampfkalender anderer Länder angebunden wird.</li>
<li>Integration von Grafiken für die Resultate</li>
</ul>

<p>Habt ihr ein Feature welches umbedingt eingebaut werden soll oder ein Bug entdeckt? Schreibts in den Kommentaren oder direkt an <a href='mailto:me@yannisguedel.ch' >me@yannisguedel.ch</a></p>

<p>PS: Falls du ein Entwickler bist: MyOApp ist Open-Source. Zögere nicht ein Pull Request für dein Traum-Feature zu senden: <a href='https://github.com/yannisgu/myoapp-react' >https://github.com/yannisgu/myoapp-react</a>  </p>]]></description><link>http://blog-yannis.azurewebsites.net/2015/12/01/myoapp-2-0-mit-integrierter-resultat-ansicht/</link><guid isPermaLink="false">c5dc36ef-5823-491b-83ad-f36e0b0814a9</guid><dc:creator><![CDATA[Yannis Güdel]]></dc:creator><pubDate>Tue, 01 Dec 2015 08:13:41 GMT</pubDate></item><item><title><![CDATA[LiveOMeter - Be the first one to discover mistakes]]></title><description><![CDATA[<p>Following an Orienteering race by GPS is quite hard. In a middle distance there are about 20 runners running on the same time, in a long distance there are even more than 40. It's just impossible to follow each one at the same time. And watching a point moving extermly slowly is quite boring - except the runner is doing a mistake.  </p>

<p>That's why I built a small tool, which discovers mistakes based on GPS data: <a href='http://liveometer.azurewebsites.net/' >LiveOMeter</a>. LiveOMeter gets its data from GPSSeuranta. For each event tracked with GPSSeuranta you can draw the course on the map and LiveOMeter will calculate the splittimes for every runner. LiveOMeter then calculates which splittimes can be considered as error and show them accordingly in the results: <br />
<img src='http://blog-yannis.azurewebsites.net/content/images/2015/Sep/liveometer.PNG'  alt="LiveOMeter" /></p>

<p>To use LiveOMeter proceed with the following steps:</p>

<ol>
<li>Open LiveOMeter: <a href='http://liveometer.azurewebsites.net/' >http://liveometer.azurewebsites.net/</a>  </li>
<li>Select an event in the dropdown at the top of the page.  </li>
<li>Click on "Draw course"  </li>
<li>Draw the course on the right panel on the map simply by clicking on the start and then on every control.  </li>
<li>Click on "Finish drawing course". This will save the course on your local computer, so you don't have to redraw it the next time you visit the event.  </li>
<li>Enjoy the detailed live results</li>
</ol>

<h3 id="whatisanerror">What is an error?</h3>

<p>LiveOMeter uses a similar algorithm as WinSplits to detect errors: For each leg, a quotient of the average of the 25% fastest split times and the runner's split time is calculated. These quotients are called performance indices. The medium value of the runner's performance indices over the whole course is considered the runner's normal performance for the course. If for a leg the performance indice is 10 per cent bigger than his normal performance the leg will be considered as error. </p>

<h3 id="troubles">Troubles</h3>

<p>Note that there are currently some restrictions/bugs/problems:</p>

<ul>
<li>There is no autorefresh on a live event. To get the newest data you will need to reload the page and reselct the event.</li>
<li>Forkings and loops are not directly supported</li>
<li>No styling was done so far... so it looks a little bit ugly</li>
<li>LiveOMeter uses the first passage at the control as splittime. If the runner passed next to a control while going to another, this will be used as splittime, so there will be a negative time. </li>
</ul>

<p>If you find any other bugs fill free to report them on GitHub: <a href='https://github.com/yannisgu/LiveOMeter/issues' >https://github.com/yannisgu/LiveOMeter/issues</a> <br />
Or if you are a developer, don't hesitate to do a pull request!</p>]]></description><link>http://blog-yannis.azurewebsites.net/2015/09/27/liveometer-be-the-first-one-to-discover-mistakes/</link><guid isPermaLink="false">4a30927d-d3ed-4e4e-bc96-a9b205206290</guid><category><![CDATA[LiveOMeter]]></category><category><![CDATA[orienteering]]></category><category><![CDATA[tool]]></category><dc:creator><![CDATA[Yannis Güdel]]></dc:creator><pubDate>Sun, 27 Sep 2015 15:01:41 GMT</pubDate></item><item><title><![CDATA[Announcing OcadDiff - a small tool to visualize changes between Ocad files]]></title><description><![CDATA[<p>The last week I had time to work on a small tool for Orienteering Mappers and Course Setters: <a href='http://github.com/yannisgu/OcadDiff' >OcadDiff</a>.  OcadDiff takes two versions of an Ocad Map or Course Setting file and shows the difference between the two versions: <br />
<img src='http://blog-yannis.azurewebsites.net/content/images/2015/Aug/OcadDiff.png'  alt="" />
Basically it compares all objects of both files and shows a preview image for each object which is not anymore in the map or which gots added to the map.</p>

<p>OcadDiff can be downloaded <a href='https://github.com/yannisgu/OcadDiff/releases' >from the download page</a>.</p>

<p>Currently OcadDiff has a limited function set and there are some restrictions users must know:</p>

<ul>
<li>Only changes to objects will be shown. Changes to symbols, courses or other settings will be ignored</li>
<li>If an object changes OcadDiff will show the object once as removed and once as added, since it does not understands that the added and removed object are actually the same</li>
<li>There is no support for background maps</li>
<li>Some symbols like a earth wall or a small erosion gully are not drawn correctly</li>
</ul>

<p>If you find other issues or you have ideas for additional features don't hesitate to create a <a href='http://github.com/yannisgu/OcadDiff/issues' >GitHhub issue</a> or to drop me a line via email: <a href='mailto:me@yannisguedel.ch' >me@yannisguedel.ch</a>. And if you are a developer, don't hesitate to contribute with a pull request!</p>]]></description><link>http://blog-yannis.azurewebsites.net/2015/08/17/announcing-ocaddiff-a-small-tool-too-visualize-changes-between-ocad-files/</link><guid isPermaLink="false">654f84a9-e511-4df6-bd5b-5b668117318a</guid><dc:creator><![CDATA[Yannis Güdel]]></dc:creator><pubDate>Mon, 17 Aug 2015 20:23:09 GMT</pubDate></item><item><title><![CDATA[Continous Deployment on Azure App Services - Customize the deployment process]]></title><description><![CDATA[<p>So this is already the third part of my serie about Continous Deployment on Azure App Services (which is the new name of Azure Websites). In <a href='http://blog.yannisguedel.ch/2015/07/03/continuous-deployment-on-azure-app-services/' >the first part</a> I talked about what Continuous Deployment is and how it could easily be configured on Azure App Services. In <a href='http://blog-yannis.azurewebsites.net/2015/07/04/continuous-deployment-on-azure-app-services-staging-environment/' >the second post</a> I showed how to add a staging environment so that you have a chance to test your changes before they are deployed to production. Now in this post I will show how the deployment process can be customized. </p>

<h3 id="cusomdeploymentscript">Cusom deployment script</h3>

<p>The most transparent way to customize the deployment process is to have a custom deployment script. In fact what Azure does during deployment when there is no script, it just creates one for you. The easiest starting point is to let Azure create this deployment script which can then be customized according to your needs. In order to generate this script you need the <a href='https://azure.microsoft.com/en-us/documentation/articles/xplat-cli/' >Azure CLI tools</a>. You can use the <a href='http://go.microsoft.com/?linkid=9828653&amp;clcid=0x409' >Windows Installer</a> to install those tools or run <code>npm install azure-cli -g</code> if you have node installed.</p>

<p>Now navigate to the root folder of your repository with your favorite command line tool. If you have a ASP.NET application run this command to create the script:  </p>

<pre><code>azure site deploymentscript --aspWAP .\path\to\Website.csproj --solutionFile MySolution.sln  
</code></pre>

<p>Replace <code>.\path\to\Website.csproj</code> and <code>MySolution.sln</code> with the relative path to the csproj of your ASP.NET website of to your solution. Now this created a deployment script called <code>deploy.bat</code> in the root of your repository. The next time a deployment happens on Azure, this script will be used. If you look at the script there are basically 3 steps which are performed by default:</p>

<ol>
<li>Restore NuGet packages  </li>
<li>Build the website and deploy with Web-Deploy to a temporary location  </li>
<li>Sync the temporary location to the webite root directory</li>
</ol>

<p>To customize the process just edit the <code>deploy.bat</code>. We could for example add a Web.config transformation during the deployment. Normally you have different configurations for your local development environment and for the production environment, e.g. connection strings. This can be handled from the Azure Portal but then the config is not versioned under source control. Instead we just could create a <a href='https://msdn.microsoft.com/en-us/library/dd465326%28v=vs.110%29.aspx' >XDT File</a> called Web.Prod.config which contains all the settings for the production. In order to perform the Web.config transform during the deployment, we need to call msbuild with the following parameter: <code>/p:PublishProfile=Prod;VisualStudioVersion=12.0</code>. In the generated script the <code>msbuild</code> looks like this:  </p>

<pre><code>:: 2. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (  
  call :ExecuteCmd "%MSBUILD_PATH%"
      "%DEPLOYMENT_SOURCE%\path\to\Website.csproj"
      /nologo /verbosity:m /t:Build
      /t:pipelinePreDeployCopyAllFilesToOneFolder
      /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release
      /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\"
      %SCM_BUILD_ARGS%
) ELSE (
  call :ExecuteCmd "%MSBUILD_PATH%"
      "%DEPLOYMENT_SOURCE%\path\to\Website.csproj"
      /nologo /verbosity:m /t:Build
      /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release
      /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\"
      %SCM_BUILD_ARGS%
)
</code></pre>

<p>You can see that MSBuild is called with different parameters in case the deployment happens directly in the web root or if it happens in a temp directory which is then copied to the web root. Basically we need to add our parameters to the <code>SCM_BUILD_ARGS</code> variable. To do this add the following line after <code>:: 2. Build to the temporary path</code>:  </p>

<pre><code>SET SCM_BUILD_ARGS="%SCM_BUILD_ARGS% /p:PublishProfile=Prod;VisualStudioVersion=12.0"
</code></pre>

<p>So now when the next deployment happens the Web.Prod.Config file will be transformed to the Web.config file.</p>

<h3 id="summary">Summary</h3>

<p>In this post I only showed an example what could be customized during the deployment pipeline. However with a custom deployment script you can just do anything you would like to do during the deployment.</p>]]></description><link>http://blog-yannis.azurewebsites.net/2015/07/15/continous-deployment-on-azure-app-services-customize-the-process/</link><guid isPermaLink="false">941c38db-4828-475b-b02d-f52949bca677</guid><dc:creator><![CDATA[Yannis Güdel]]></dc:creator><pubDate>Wed, 15 Jul 2015 15:26:44 GMT</pubDate></item><item><title><![CDATA[Continuous Deployment on Azure App Services - Staging environment]]></title><description><![CDATA[<p>Ok, this is the second post of the serie about Continuous Deployment on Azure App Services (also known as Azure Websites). So if you haven't read the <a href='http://blog.yannisguedel.ch/2015/07/03/continuous-deployment-on-azure-app-services/' >first post with an introduction about Continuous Deployment on Azure App Services</a> you defintly should! <br />
In the first post I showed how to configure a basic website to continuously deploy. In this post I want to show how you can add a staging environment of the website so that you can safely test your code before putting it in production.</p>

<p>Luckly Azure App Services has a pretty good support of staging environemnt which then can be easily be swapped with the current production environment. Note that this functionality is only avaiable with the standard plan. </p>

<p>To create the staging website, open the previously created production website. I you haven't any, check <a href='http://blog.yannisguedel.ch/2015/07/03/continuous-deployment-on-azure-app-services/' >part 1 of this serie on how to create one</a>. Make sure the app runs on a standard plan and go to <code>Settings =&gt; Deployment Slots</code> <br />
<img src='http://yagblog.blob.core.windows.net/images/DeploymentSlots.png'  alt="Deployment slots" /></p>

<p>Next click on the <code>Add Slot</code> button and fill the form. I strongly advice taking the production website as Configuration Source. <br />
<img src='http://yagblog.blob.core.windows.net/images/AddDeploymentSlot.png'  alt="Deployment slots" />
Now Azure created a copy of our Web App which can be easily be swapped with the original one. On this Web App we now need to reconfigure the continuous deployment <a href='http://blog.yannisguedel.ch/2015/07/03/continuous-deployment-on-azure-app-services/' >as we did for the original one</a>. For this go to <code>Deployment =&gt; Set up continuous deployment</code> and provide the details of your source code repository. <br />
<img src='http://yagblog.blob.core.windows.net/images/ConfigureCDStaging.PNG'  alt="Configure Azure CD" /></p>

<p>At this point we want all deployment happen on our staging Web App. There should be no direct deployment to our production Web App. That's why we need to disable automatic deployment on the production Web App. So open it and go to the deployment settings. Here simply click <code>Disconnect</code>. <br />
<img src='http://yagblog.blob.core.windows.net/images/StagingDisconect.PNG'  alt="Disconnect" /></p>

<p>Now when you change something to your code and push it to the <code>master</code> it will deploy the change to the staging Web App. You can then test it here and update it if necessarily. When everything looks good and you want to publish the changes to production, simply press the <code>Swap</code> button. <br />
<img src='http://yagblog.blob.core.windows.net/images/Swap.PNG'  alt="Disconnect" />
Done. So what happened when we swapped both web apps? Basically the file system of both Web Apps interchanged. So the production Web App now serves what was staging before and the staging one servers the files from the last deployment.</p>

<h3 id="conclusion">Conclusion</h3>

<p>In this post showed how to easily configure a staging environment for you Azure Web App in order to deploy quickly but still have an environment where we can test everything. <br />
In the next post of the serie "Continuous Deployment on Azure App Services" I will show how the build and deployment process can be customzied. Stay tuned! </p>

<p>And don't forget to <a href='http://twitter.com/yannisgu' >follow me on Twitter</a> to get an update when the next post is out.</p>]]></description><link>http://blog-yannis.azurewebsites.net/2015/07/04/continuous-deployment-on-azure-app-services-staging-environment/</link><guid isPermaLink="false">1585fd91-3955-46e1-8cbf-567f52077f6f</guid><category><![CDATA[azure]]></category><category><![CDATA[azure app services]]></category><category><![CDATA[continuous deployment]]></category><dc:creator><![CDATA[Yannis Güdel]]></dc:creator><pubDate>Sat, 04 Jul 2015 15:10:35 GMT</pubDate></item><item><title><![CDATA[Continuous Deployment on Azure App Services - The Intro]]></title><description><![CDATA[<p>Today I want to talk about one of my favorites topics in Software Development: Continuous Deployment. And since talking only about one topic would be pretty boring I want to mix it with another topic I like pretty much: <a href='http://azure.com/' >Microsoft Azure</a>. <a href='http://weblogs.asp.net/scottgu/announcing-the-new-azure-app-service' >Azure Websites or Azure App Services</a> as they are called nowdays to be more precise.</p>

<p>In this post I want to make sure the terminology is clear and I will talk about how to setup continous deployment for a basic ASP.NET web site. In the following blog posts I want then proceed to more advanced topics when it comes to continuous deployment on Azure App Services. So let's start with some terms.</p>

<h2 id="whatiscontinousdeploymentabout">What is Continous Deployment about?</h2>

<p>Well the base idea is to deploy every change as fast as possible to production. The idea behind this concept is that small change = low risk to break anything. When you deploy lot of features at the same time, the risk to break anything is just bigger than when deploying only a small portion at a time. And well if something breaks it's clear which feature introduced it and it's also fairly easy to rollback to a previous version. However continuous deployment doesn't come for free. There are some requirements your code must have before you can start with continuous deployment: </p>

<ul>
<li>Build, installation and deployment including changes to the database must be <strong>fully</strong> automated. And this is valid for every step of the installation of the web site, even if it only would take 10 seconds to do manualy. Just automate everyting!</li>
<li>Automated tests are not voluntary. Idealy there are Unit Tests for logic and Integration Tests for functionality. The minimum is that there is some sort of tests. </li>
<li>There must be simple way to rollback the deployed code. The challenge here is to have the database in sync with code. The best way is to never introduce breaking changes on database level. Never delete a column or table, never rename a column or table, never change the type of column. Create a new one and copy the data is often the better solution when working in a continuous deployment environment. The other possibility is to have database migrations which when applied doesn't care if the database is behind or in front of the current code.</li>
<li>You need to have your source code cleanly versioned in a VCS. Git is highly recommended here.</li>
</ul>

<h2 id="andwhatareazureappservices">And what are Azure App Services?</h2>

<p>Azure App Services which were called Azure Websites previously are the PaaS from Microsoft. They provide an super easy way to host ASP.NET, Node.JS, PHP, etc... web applications. In addition of hosting applications, Azure App Services provides a lot more features needed when operating a web application: Monitoring, Performance Analysis, Analytics, automated deployment, everything can be done directly from the Azure Portal. And the coolest thing is that you can have 10 Azure App Services running for <strong>free</strong>. So if if you haven't an Azure account yet, you should start directly by creating a new one at <a href='https://tryappservice.azure.com/' >https://tryappservice.azure.com/</a></p>

<h2 id="enoughterminologyiwanttohavemycodedeployed">Enough terminology, I want to have my code deployed!</h2>

<p>Ok, so for this demo I will use the new Azure Portal located at <a href='http://portal.azure.com/' >http://portal.azure.com/</a>. You can create an new website with <code>New =&gt; Web + Mobile =&gt; Web App</code> <br />
<img src='http://yagblog.blob.core.windows.net/images/NewWebApp.png'  alt="New Web App" />
Enter the details here. You can select a free website here: <br />
<img src='http://yagblog.blob.core.windows.net/images/NewWebAppDetails.PNG'  alt="New Web App Details" /></p>

<p>And now the fun begins. Open you fresh website in the portal and select "Setup Continuous Deployment" <br />
<img src='http://yagblog.blob.core.windows.net/images/SetupCD.PNG'  alt="Setup CD" /></p>

<p>Choose your Git or Mercurial repository here, depending on where it is hosted. You can fork my <a href='https://github.com/yannisgu/AspNetDemo' >demo ASP.NET website</a> from Github if you need one to test. Now Azure will automatically build and deploy the website. Of course a NuGet restore will be done before the build is started. <br />
And the collest thing of this whole stuff: anytime you commit something to master it will automatically deployed to your website!</p>

<h2 id="conclusionandfuture">Conclusion and Future</h2>

<p>So now with only a few clicks we have a working continuous deployment environemnt on Azure! Of course this example was very basic and for real world projects some customization can be needed. So more posts about Continuous Deployment and Azure App Services. The next topics will be:</p>

<ul>
<li>Customize the deployment process</li>
<li>Rollback a deployment</li>
<li>Add a staging environment</li>
<li>Automate the setup</li>
<li>Add test environments for different branches</li>
</ul>

<p><a href='https://twitter.com/yannisgu' >Follow me on Twitter</a> to stay updated when a new post is out!</p>]]></description><link>http://blog-yannis.azurewebsites.net/2015/07/03/continuous-deployment-on-azure-app-services/</link><guid isPermaLink="false">097e0198-c407-4dcd-ae9f-37036e02d9f7</guid><category><![CDATA[azure]]></category><category><![CDATA[azure app services]]></category><category><![CDATA[continuous deployment]]></category><dc:creator><![CDATA[Yannis Güdel]]></dc:creator><pubDate>Fri, 03 Jul 2015 21:25:48 GMT</pubDate></item><item><title><![CDATA[Write a custom plugin/provider for OneGet]]></title><description><![CDATA[<p>Two days ago I saw a really interesting tweet from Scott Hanselman:</p>

<blockquote class="twitter-tweet" lang="en"><p>Apt-Get for Windows &quot;OneGet&quot;, supports <a href='https://twitter.com/chocolateynuget' >@chocolateynuget</a>. Thanks <a href='https://twitter.com/ferventcoder' >@ferventcoder</a> for helping them see the light! <a href='http://t.co/JfBoSxehtB' >http://t.co/JfBoSxehtB</a></p>&mdash; Scott Hanselman (@shanselman) <a href='https://twitter.com/shanselman/statuses/451786199389044736' >April 3, 2014</a></blockquote>  

<script async src='http://platform.twitter.com/widgets.js'  charset="utf-8"></script>

<p>I know chocolatey quite good and have used it several times to automate machine installs, but this "OneGet" was new to me. So I opened the link and went through this blog post from Microsoft. I almost freaked out when I realized this was the announcment of the preview of PowerShell 5, which includes chocolatey in its core. That's so cool, since it fills a big gap between Linux and Windows. But OneGet is not only Chocolatey it's a set set of command to talk with a package manager. Chocolatey is simply the first package provider which can be used with OneGet. In this blog post I won't explain a lot about OneGet, since others have done this before. If you never heard about OneGet, read first <a href='http://withinwindows.com/within-windows/2014/4/5/a-closer-look-at-windows-powershell-oneget-part-1' >the blog post withinwindows.com</a>  before you continue.</p>

<p>Well, what about other package manager, how can they benifit from OneGet. In this blog post I you will explain how to write your custom provider from OneGet. Since there is no documentation, this post is based on reflection. So the official way will probably be a bit different than this, but I am sure the core concept will keep the same. According to the <a href='https://github.com/OneGet/oneget/wiki/Q-and-A' #can-i-build-my-own-package-manager-plugin">wiki on github</a> (yes github, it will be open-source!!) it will be possible to write plugins in .NET or PowerShell. I will only cover the .NET-Part in this post.</p>

<h2 id="writeownpackageprovider">Write own package provider</h2>

<p>So let's start. Basicaly a plugin is a DLL which must contain two classes: A plugin and a provider. A plugin could provide different providers and is responsible to create this providers. In this example we only have one provider for the plugin.  The DLL has then to be placed in the OneGet-Module folder under <code>C:\Windows\System32\WindowsPowerShell\v1.0\Modules\OneGet</code> and registered in the OneGet-Module Metadata file (OneGet.psd1).</p>

<p>The provider and the plugin don't need to implement any interface or to inherit from any class, but they have to implement a specific set of methods and properties. </p>

<p>The plugin needs this members:  </p>

<script src='https://gist.github.com/yannisgu/10531402.js' ></script>

<p>And that provider needs to implement the following memebers:  </p>

<script src='https://gist.github.com/anonymous/10531239.js' ></script>

<p><strong>Note:</strong> There could be more members and not all required, but this are the memebers, the chocolatey provider implements, so that is probably a good base.</p>

<p>Every method in the provider class has a parameter "c" of type <code>Func&lt;string, IEnumerable&lt;object&gt;, object&gt;</code>. This function is like a factory to create functions to interact with powershell. E.g. if you call <code>c("YieldPackage", null)</code> you get a function to give a package  back to PowerShell in the <code>GetInstalledPackages</code> or <code>FindPackages</code> method. </p>

<p>I will not explain every method here, but you <a href='http://blogyag.blob.core.windows.net/images/CustomPackageProvider.zip' >can download my example package provider</a> to explor the details how to implement your own package provider.</p>

<h3 id="testthepackageprovider">Test the package provider</h3>

<p>To test your provider, compile your package provider and put the DLL and the dependencies into C:\Windows\System32\WindowsPowerShell\v1.0\Modules\OneGet <br />
<strong>Note:</strong> Do not forget to copy the Semver.dll library when you test my example.</p>

<p>Then you have to register the plugin. Edit the file C:\Windows\System32\WindowsPowerShell\v1.0\Modules\OneGet\OneGet.psd1 file as administrator. Then edit the line <code>'Microsoft.OneGet.Plugin.Chocolatey'</code> to <code>'Microsoft.OneGet.Plugin.Chocolatey', 'NameOfMyDll'</code> <br />
<strong>Note:</strong> <a href='http://www.addictivetips.com/windows-tips/take-ownership-of-files-folder-and-change-permissions-in-windows-8/' >On Windows 8 you first have to be owner</a> of the C:\Windows\System32\WindowsPowerShell\v1.0\Modules\OneGet folder, to edit the file.</p>

<p>Then test your package by running <code>Get-Package</code> in a <strong>new</strong> PowerShell console.</p>]]></description><link>http://blog-yannis.azurewebsites.net/2014/04/12/chocolatey-in-the-powershell-core/</link><guid isPermaLink="false">af118da4-f016-490b-8ed4-07202904ebfa</guid><category><![CDATA[oneget]]></category><category><![CDATA[powershell]]></category><category><![CDATA[windows management framework]]></category><dc:creator><![CDATA[Yannis Güdel]]></dc:creator><pubDate>Sat, 12 Apr 2014 11:37:53 GMT</pubDate></item></channel></rss>