16 April 2014

Had a need to write a re-usable function at work to compare version numbers so that an action could be taken accordingly.  It’s pretty simple but thought I’d share it anyway. Function verCompare($ver1, $ver2) { # returns whether ver1 is Less, Greater, or Equal to ver2 $ver1Array = $ver1.Split(“.”) $ver2Array = $ver2.Split(“.”) # Decide which […]

3 February 2014

As part of my slow-moving efforts within my company to get WinRM enabled across the enterprise (14,000 computers…) I’ve had to do a bit of testing to make sure I can properly secure it.  Much of that testing is around setting the execution level and making sure nothing outside of what I or my team […]

23 January 2014

A little while ago I had a dilemma brought to me at work from an application team.  One of the tings we have fought using the Dragon Naturally Speaking application is the loss of data or profile corruption due to the application not being properly shut down. The solution provided to us by a third […]

2 March 2013

EDIT:  This is my old, kludgey way of doing it.  Please see this new post:  Remotely Enabling WinRM – Improved! ********************* This post is going to build off of the technique I used in my previous post.  My company only recently deployed Powershell to all of our XP devices.  But neither the XP nor Windows […]

28 February 2013

I searched far and wide over the internet looking for an easy way to elevate powershell in a script whenever I needed to.  The only solutions I ever found were practically a full page of code to look at this, and check that, then do this, jump through this hoop so it could do that… […]

21 January 2013

A couple of days after I made my last post I realized that, for that specific purpose, I could have just dynamically created hashtables as the values of each array.  It would look like this pseudo-code: $array = @() $array += @{ DriveLetter = $object.DriveLetter TotalSpace = $object.Size FreeSpace = $object.FreeSpace } Just remember to […]

4 January 2013

I was building a more involved function the past couple of days for gathering data from a PC in the enterprise should troubleshooting be necessary.  The type of company I work for doesn’t always allow us to stay on the PC and troubleshoot an item (unless it’s a total blocker) so being able to gather […]

20 November 2012

I need to vent a little before I get into the code.  Had a frustrating one today!  All because of unclear documentation in MSDN’s published library of their .NET classes. I guess it’s true what they say, that sometimes you should listen to what isn’t said. I had to build a work-around to a problem […]

16 November 2012

Bleh!  I’ve been so busy with the new position I started in April I’ve fallen off posting on this blog.  I have a lot of Powershell stuff I want to post—creating progress/activity bars, hashing, and perhaps a series on creating a simple text console.  I’ve also not been paying attention to replies, sorry!  I get […]

2 May 2012

UPDATE 01/30/2014 There is a registry hack in Windows 7 to enable this feature again (although I wouldn’t necessarily suggest it… MS doesn’t support it). You can naviGate to HKEY_CLASSES_ROOT\AppID\{CDCBCFCA-3CDC-436f-A4E2-0E02075250C2}  and clear out the value for RunAs.  This will enable the ability to do a runas and have explorer run in a separate process.  If […]