Archives / 2012 / January

Using PowerShell to represent Base 26 as the uppercase English Alphabet

Jan 10 2012No Comments by justin

Today I was asked to do something that seemed simple, until I actually had to do it. A coworker had a database with two fields he wanted renamed in a specific way. For our example, lets call them ProductNumber and ProductName. He wanted ProductNumber to be sequential (1, 2, 3 . . .) and the ProductName fields to be called "Product A", "Product B" . . . "Product Z", "Product AA" etc. So this suddenly became a non-trivial problem if you had more than 26 rows, which of course I did. So I rolled …

Algorithims, Math, PowerShell Read more

Making an RDP connection to a server you just rebooted with PowerShell

Jan 08 2012No Comments by justin

Update: With the release of PowerShell 3.0 imminent, I wish to draw everyone's attention to Shay Levy's (blog|twitter) simplified Posh v3 version. It's an all to familiar story. You  need to reboot a server, and then you need to start a remote desktop connection into it. So what do you do? You open up a command prompt, type ping -t <HOSTNAME> and wait until the server responds to pings. When that happens, you keep trying to connect via remote desktop, until it works. There's got to be an …

PowerShell, Remote Desktop, System Administration Read more