<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Powershell on dwmkerr.com</title><link>https://dwmkerr.com/categories/powershell/</link><description>Recent content in Powershell on dwmkerr.com</description><generator>Hugo -- gohugo.io</generator><language>en-uk</language><managingEditor>Dave Kerr</managingEditor><copyright>Copright &amp;copy; Dave Kerr</copyright><lastBuildDate>Sun, 30 Mar 2014 11:40:16 +0000</lastBuildDate><atom:link href="https://dwmkerr.com/categories/powershell/index.xml" rel="self" type="application/rss+xml"/><item><title>Managing Vsix Deployments with Powershell</title><link>https://dwmkerr.com/managing-vsix-deployments-with-powershell/</link><pubDate>Sun, 30 Mar 2014 11:40:16 +0000</pubDate><guid>https://dwmkerr.com/managing-vsix-deployments-with-powershell/</guid><description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt; - &lt;a href="https://github.com/dwmkerr/vsix-tools"&gt;vsix-tools&lt;/a&gt; fixes the &amp;lsquo;Invalid Multiple Files in VSIX&amp;rsquo; issue on the Visual Studio Gallery and lets you set vsix version numbers with Powershell.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I maintain a reasonably large project called SharpGL. This project contains two Vsix packages (Visual Studio Extensions), each of which contains project templates for Visual Studio.&lt;/p&gt;
&lt;p&gt;If you have ever worked with Vsix files before you might have noticed that the tools for them in Visual Studio seem a little flaky - but even more so is that Visual Studio Gallery site that you have to use to upload your extensions.&lt;/p&gt;
&lt;p&gt;Add more than one project template to your Vsix and try and upload it - this is what you&amp;rsquo;ll see:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dwmkerr.com/wp-content/uploads/2014/03/InvalidMultipleZipFilesInVsix.jpg"&gt;&lt;img src="images/InvalidMultipleZipFilesInVsix.jpg" alt="InvalidMultipleZipFilesInVsix" width="263" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s a pain to solve this problem - basically you need to change the folder structure within the vsix file, then change the xml that describes it. Now this is not too much of a problem if you do it once or twice, but if you&amp;rsquo;re in the situation where you want to be able to build a release of your code rapidly, including extensions, this will seriously slow you down.&lt;/p&gt;
&lt;p&gt;Enter &lt;a href="https://github.com/dwmkerr/vsix-tools"&gt;VsixTools&lt;/a&gt;, a little Powershell script that lets you resolve this issue and as a bonus lets you set the version in the Vsix as well - very useful for scripts that build releases. You can use it like this:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# Load vsix tools
. VsixTools.ps1
# Set the version number of &amp;#39;MyPackage&amp;#39; and fix the zip issue for uploading to the gallery.
$vsixPath = &amp;#34;c:/MyPackage.vsix&amp;#34;
Vsix-SetVersion -VsixPath $vsixPath -Version &amp;#34;2.2.0.1&amp;#34;
Vsix-FixInvalidMultipleFiles -VsixPath $vsixPath&amp;lt;/pre&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This Powershell script has no dependencies, it&amp;rsquo;s just Powershell 2.0. Get the script at &lt;a href="https://github.com/dwmkerr/vsix-tools"&gt;github.com/dwmkerr/vsix-tools&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It works for package manifests of version 1 or 2 - for anyone who&amp;rsquo;s lucky enough to have not had to delve into the internals of this that means that it works from Visual Studio 2010 onwards.&lt;/p&gt;</description><category>CodeProject</category></item></channel></rss>