Archive for the ‘PowerShell’ Category

Download mvcConf session videos with a PowerShell script (should work with other Channel 9 feeds, too)

I tweaked my NuGet downloader PowerShell script to handle the Channel 9 media feeds, so you can grab a local copy of all session videos in the format of your choice: WMV (high and low quality) MV4 (high and low quality) MP3 WMA There are…

How to change the default browser in Visual Studio programmatically with PowerShell and possibly poke yourself in the eye

UPDATE: Why my own MacGyver solution was brilliant in its horrible way, the folks over at World of VS have taken up the challenge and created a proper Visual Studio extension that you should use. I'll chat with them and get some details and maybe a write-up of how they did it. So, while I encourage you to enjoy my tale below, go get the World of VS Default Browser Switcher now! I've heard and seen lots of complaints about how it's hard to set the default browser that Visual Studio launches when you launch a debug session for a website. Step 0 – Adequate Folks spend time hunting around the Tools|Options dialog in Visual Studio looking for setting. They eventually realize it's not in there at all, but instead you have to right…(read more)

get-isadmin.ps1

Here’s a simple way to tell if you’re running as an administrator from within PowerShell:$windowsIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent() $windowsPrincipal = new-object ‘System.Security.Principal.WindowsPrincipal’ $windowsIdentity return $windowsPrincipal.IsInRole(“Administrators”) I like to use this right at the top of my startup profile to turn my…

Calculating SHA1 in PowerShell

I can never remember where (or the name of) the random .EXE that I usually keep around for calculating SHA1 hashes is, and it seemed silly not to just spend the 10 minutes to write it in PowerShell. After all,…

vsvars2010.ps1

A new version of Visual Studio is just around the corner, so it’s time for my newest member of the scripts folder: vsvars2010.ps1. This PowerShell script will set up your environment to run all the development tools from Visual Studio…

pause.ps1

I needed a “pause” command for some of my PowerShell scripts, so this is what I ended up with. Enjoy. param( [string]$message = “Press any key to continue…” ) Write-Host -NoNewLine $Message $Host.UI.RawUI.FlushInputBuffer() do { $key = $Host.UI.RawUI.ReadKey(“NoEcho,IncludeKeyDown”).Character } while…