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/
Friday, April 5, 2013
I’ve spent a little while creating a powershell module that can be used to call MsBuild. It returns whether the build succeeded or not, and runs through the Visual Studio command prompt if possible, since some projects can’t be built by calling msbuild directly (e.g. XNA projects). It also provides several other parameters to do things like show the window performing the build, automatically open the build log if the build fails, etc.
Here is the script…
Read more at http://blog.danskingdom.com/invoke-msbuild-powershell-module/
Monday, March 18, 2013
Post and code updated on March 21, 2013, and again on March 22, 2013.
We recently upgraded from VS (Visual Studio) 2010 to VS 2012, and with it had to upgrade our .dbproj database project to a .sqlproj. When making the switch I realized that .sqlproj database projects do not support specifying the database to deploy to as MSBuild command line arguments; instead you have to pass in the path to an xml file that has the necessary information.
So with the old .dbproj database project, you could deploy it to a database using…
Read more at http://blog.danskingdom.com/using-msbuild-to-publish-a-vs-2012-ssdt-sqlproj-database-project-the-same-way-as-a-vs-2010-dbproj-database-project/
Friday, March 8, 2013
A while ago I blogged about a powershell script I made that would automatically update your ClickOnce project file’s Minimum Required Version to the latest version of your application so that users would not be presented with the “There is an update for this application. Do you want to install it?” prompt; instead the application would just automatically download and install the update. This is nice because it’s one less prompt the end-user has to see, and from a security standpoint it means that your users will be forced to always use the latest version of the app.
There was a bit of setup to get this to work. You had to make sure the powershell script was in the proper directory and add a post-build event to your project. I’m happy to announce that I’ve significantly updated the powershell script with more features and bug fixes, and you can now install it from Nuget, which will handle all of the setup for you. So now making sure that your end-users are always using the latest version of your application is as easy as…
Read more at http://blog.danskingdom.com/force-your-clickonce-app-to-update-without-prompting-user-now-on-nuget/
Saturday, January 19, 2013
I love AutoHotkey (AHK). Ever since I discovered it a little over a year ago I am constantly surprised and pleased with what I am able to accomplish with it. And there in lied my problem. Out of the box, AHK allows you to trigger your own scripts using hotkeys. My problem was that I had so many of these little (and some large) scripts to do so many things, that i quickly ran out of hotkeys to use that wouldn’t interfere with other application’s shortcut keys (Visual Studio anyone); also even if I had more hotkeys available, trying to remember which ones did what was a nightmare. To remedy this, I created AHK Command Picker.
AHK Command Picker is really just a little UI that allows you to quickly run your scripts; so instead of using a hotkey, you just…
Read more at http://blog.danskingdom.com/too-many-autohotkey-shortcuts-to-remember-theres-an-app-for-that/
Wednesday, December 5, 2012
Hey everyone, I know many of us regularly use Sharepoint for document storage in order to make documents available to several people, have it version controlled, etc. Doing this through the Web UI can be a real headache, especially when you have multiple documents you want to modify or upload, or when IE isn’t your default browser. Luckily we can access the Sharepoint library like a regular network drive if we like.
Open Sharepoint in Internet Explorer (other browsers don’t support the Open with Explorer functionality), navigate to wherever your documents are stored, choose…
Read more at http://blog.danskingdom.com/making-document-storage-in-sharepoint-a-breeze-leave-the-web-ui-behind/
Tuesday, December 4, 2012
If you are like me and don't want to have to enter your password each time Windows loads, you can have Windows start up without prompting you to enter a user name or password. The simple (and BAD) way to do this is to simply not have a password on your user account, but that’s a big security risk and will allow people to easily remote desktop into your computer.
So, first set a password on your windows account if you don’t already have one. Then select Run... from the start menu (or use Windows Key + R to open the Run window) and type…
Read more at http://blog.danskingdom.com/have-windows-automatically-login-without-entering-your-password/