Skip to main content

Posts

Showing posts from March, 2011

Is was nice knowing you Reflector...

When it was announced that Reflector was being acquired by RedGate I knew it was only a matter of time before this free tool became a paid one. What I was looking for instead of a free tool was an open source one. The good people over at SharpDevelop have provided just such a tool, ILSpy. While the tool isn't as full of features as Reflector had become, it is at least functional at the basic level, and open source.

The one thing I dislike about all these tools, I have to download them to multiple workstations. I wonder if I could find/start a web-based .NET decompiler service... one that uses PowerShell for plugins.

ASP.NET MVC Authorization via PowerShell

I have devised a way to build a PowerShell authorization script for ASP.NET MVC using a custom AuthorizeAttribute. It's ok, I'll give you a minute to let that settle in your mind...

Get over to the github and download the latest drop of PowerShell for ASP.NET. The System.Web.Mvc.PowerShellAuthorizationAttribute class provides you with the ability to run a PowerShell script to perform the authorization of the action or controller.

Usage is simple add the attribute to your action or controller like so:
[PowerShellAuthorization("~/App_Data/Authorize-KillProcess.ps1")]  public ActionResult Kill(string computerName, uint pid)...   And create a simple PowerShell script that returns $true or $false:
param(      [Parameter(Mandatory = $true)]  $HttpContext,      [Parameter(Mandatory = $true)]  $Principal,      [Parameter(Mandatory = $true)]  $Action,      [Parameter(Mandatory = $true)]  $RouteValues,      [switch] $Test = $false)  process {      [int]$RouteValues.pid -gt 4 `   …

I <3 PowerShell

I finally have found a topic I want to blog about: PowerShell. If you don't know what PowerShell is then I suggest you do some lite reading about it or just keep reading here and I'm sure the mental light bulb will turn on shortly.

So, why blog about PowerShell out of all the other things I could blog about, and probably will blog about? I am a literal dev-admin, the fusion of a developer and system administrator. For the past 10 years I have been working in the I.T. as a developer that also does system administrator work as his primary job. Having the development background I do, I am constantly looking for ways to automate my day-to-day tasks or create automation that I can have other people use if I am not around to keep the business/infrastructure running smoothly.

I started creating web-automation applications within a few months of becoming a sysadmin. Since then I have been looking for a way to make those applications easier to maintain and more powerful. If you have an…