Monday, June 24, 2013
In the preamble of an earlier post I mentioned that one of the little things that bugs me about Windows PowerShell ISE is that you can add tabs to the start of a line, but not to the end of a line. This is likely because it would interfere with the tab-completion feature. I still like to be able to put tabs on the end of my code lines though so that I can easily line up my comments. Here is how we can achieve this functionality in PowerShell ISE.
Read more at http://blog.danskingdom.com/add-ability-to-add-tabs-to-the-end-of-a-line-in-windows-powershell-ise/
Saturday, June 22, 2013
So you’ve got a super awesome library/assembly that you want to share with others, but you’re too lazy to actually use NuGet to package it up and upload it to the gallery; or maybe you don’t know how to create a NuGet package and don’t have the time or desire to learn. Well, my friends, now this can all be handled for you automatically.
Read more at http://blog.danskingdom.com/automatically-create-your-projects-nuget-package-every-time-it-builds-via-nuget/
Wednesday, June 19, 2013
I’ve written some code that you can add to your ISE profile that adds keyboard shortcuts to quickly comment and uncomment lines in PowerShell ISE. Feel free to skip the Preamble and get right to the good stuff.
Read more at http://blog.danskingdom.com/powershell-ise-multiline-comment-and-uncomment-done-right-and-other-ise-gui-must-haves/
Wednesday, June 12, 2013
I know this isn’t programming related (and thus doesn’t quite go with the theme of my blog), but I thought I’d share anyways. Pass this along to anybody you know that has an Xbox 360.
At E3 Microsoft announced that it would start giving away 2 free games a month to Xbox Live Gold subscribers.
On July 1st Assassin’s Creed 2 and Halo 3 will be available to download for free.
Right now you can go download Fable 3 for free. I downloaded it last night, so it’s legit.
To download the games, from your 360 dashboard go to:
Read more at http://blog.danskingdom.com/free-xbox-360-games-if-you-have-xbox-live-gold-subscription/
Friday, June 7, 2013
I’ve spent a good chunk of time investigating how nuget.exe works and creating a PowerShell script called New-NuGetPackage to make it dirt simple to pack and push new NuGet packages.
Here’s a list of some of the script’s features:
Read more at http://blog.danskingdom.com/create-and-publish-your-nuget-package-in-one-click-with-the-new-nugetpackage-powershell-script/
Monday, June 3, 2013
Most people will likely find the “Run script path with spaces from File Explorer” (to be able to double click a PS script whose path contains spaces to run it) section below the most helpful. Most of the other content in this post can be found elsewhere, but I provide it for context and completeness.
Read more at: http://blog.danskingdom.com/fix-problem-where-windows-powershell-cannot-run-script-whose-path-contains-spaces/
Friday, May 17, 2013
Thursday, May 16, 2013
I’m new to working with Xml through PowerShell and was so impressed when I discovered how easy it was to read an xml element’s value. I’m working with reading/writing .nuspec files for working with NuGet. Here’s a sample xml of a .nuspec xml file:
Read more at http://blog.danskingdom.com/powershell-functions-to-get-an-xml-node-and-get-and-set-an-xml-elements-value-even-when-the-element-does-not-already-exist/
Thursday, May 9, 2013
There are a few different ways to create zip files in powershell, but not many that allow you to create one that is password protected. I found this post that shows how to do it using 7zip, so I thought I would share my modified solution.
Here is the function I wrote that uses 7zip to perform the zip, and 7zip supports using a password to zip the files.
Read more at http://blog.danskingdom.com/powershell-function-to-create-a-password-protected-zip-file/
Wednesday, May 1, 2013
I love PowerShell, and when prompting users for input I often prefer to use GUI controls rather than have them enter everything into the console; some things like browsing for files or folders or entering multi-line text aren’t very pleasing to do directly in the powershell prompt window. So I thought I’d share some powershell code that I often use for these purposes.
Read more at http://blog.danskingdom.com/powershell-multi-line-input-box-dialog-open-file-dialog-folder-browser-dialog-input-box-and-message-box/