Contents tagged with PowerShell

Getting the Drive Letter of a disk image mounted with WinCdEmu

May 11 2013No Comments by justin

In my last post, I talked about mounting disk images in Windows 8. Both Windows 8 and 2012 include native support for mounting ISO images as drives. However, in prior versions of Windows you needed a third party tool to do this. Since I have a preference for open source, my tool of choice before Windows 8 was WinCdEmu. Today, I decided to see if it was possible to determine the drive letter of an ISO mounted by WinCdEMu with PowerShell. A quick search of the internet revealed that WinCdEmu …

PowerShell, WInCdEmu Read more

PoshRunner now on SourceForge and Chocolatey

Jan 06 2013No Comments by justin

I've been periodically hacking away at PoshRunner. I have lots of plans for it. Some of these are rewriting some of it in C++, allowing you to log output to MongoDB and total world domination! However, today's news is not as grand. The first piece of news is I made a PoshRunner sourceforge project to distribute the binaries. To download the latest version, click here. Secondly, there is now a PoshRunner chocolatey package, so you can install it via chocolatey. Finally, there is not a lot of …

chocolatey, Open Source, poshrunner, PowerShell Read more

Announcing poshrunner.exe so MyScript.ps1 can use MyScript.ps1.config instead of powershell.exe.config

Nov 22 2012No Comments by justin

I have a tendency to do odd things with technology so that things don't just work. When I point out the obscure edge cases I find, most people tell me, "well don't do that." I usually ignore them and dream of tilting windmills. Well today a windmill has been tilted, and this is the epic tale. I'm a developer that fell in love with PowerShell. As such I often call .NET API functions from powershell scripts. This usually just works. However, it kind of falls apart when you have to use settings …

Open Source, poshrunner, PowerShell Read more

Continuous Integration with Windows Azure SDK 1.7, Powershell and TFS Build too!

Oct 18 2012No Comments by stanley

Environments change and the solutions to support them have to keep up. I was very entertained with my old deployment solution for a good while. However, we eventually moved to Azure, and I needed to scramble to find something new. Tom Hollander's Automated Build and Deployment with Windows Azure SDK 1.6 filled that void until I upgraded my project type to the 1.7 SDK. At that point, I realized I had to roll up my sleeves and cobble something new together. From an automated deployment …

Azure, HowTo, PowerShell, Team Foundation Server Read more

MSIExec and Far Manager Part 1: Command line install and uninstall of FarManager 3

Jul 29 2012No Comments by justin

This is part one in a series of blog articles in which I shed light on the internals of MSIs using the example of the MSI for Far Manager 3. It was inspired, amongst other thing, by lessons learned while creating the Far-2 and Far-3 packages for chocolatey. While the idea of writing those packages was so others would not have to learn the dark arts of command line manipulation of MSIs, I though I would write this series for those interested in how the sausage gets made. I've written about my …

farmanager, MSI, PowerShell Read more

PowerShell 3.0 [ordered] and MongoDB

Apr 20 2012No Comments by justin

Recently, Shay Levy published a blog post about new features related to the Add-Member cmdlet in PowerShell 3.0. In it, one of the examples involved the use of [ordered]. The example, shown below is: [powershell]PS> $pso = New-Object -TypeName PSObject PS> $pso | Add-Member ([ordered]@{One=1; Two=2; Three=3}) -PassThru One Two Three --- --- ----- 1 2 3[/powershell] The take home of this example was simple; using the @{} operator by itself created a System.Hashtable object, and …

mongodb, PowerShell Read more

Using PowerShell to call a WCF service

Feb 11 2012No Comments by justin

PowerShell lets you create web service proxies from WSDLs via the New-WebServiceProxy cmdlet. However, it only works for SOAP web services running on HTTP endpoints. If you have a WCF service using only non http protocols, such as NetTcp, you cannot use New-WebServiceProxy. Now, I've created and consumed my fair share of web services. So when I began to use PowerShell, I quickly figured out this unfortunate fact. I always knew that I could make use of WCF API to generate the proxies, but I …

PowerShell, WCF Read more

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

Using MongoDB in Powershell

May 15 2011No Comments by justin

Readers of this blog know that I've been using MongoDB for a while, and I've recently become very excited about Powershell. Well recently I've been able to combine the two together for pure dynamically typed, schema-less, non-relational awesomeness. Such awesomeness is begging to be shared. To get started you will need version 1.1 of the official 10gen CSharp driver for Mongodb. At the time of this writing 1.1 has not been released, so your going to have to pull the latest version from github …

HowTo, mongodb, PowerShell Read more