Not sure who posted it, but I noticed that a copy of the code I provided was posted on PoshCode.org: http://poshcode.org/5367
I'm honestly flattered, although a link to this post would have been appreciated.
Just so everyone is aware, the code I provided is not an updated version of the code that was posted by the person who started this thread. It's code I wrote from scratch to solve the problem that was posted as I understood it.
I will be writing a future blog article on my blog at http://mikefrobbins.com where I will be not only discussing this code but a way to once and for all resolve the problem of server paths such as this one where you'll never need to change these sorts of hard coded paths ever again even if the server name changes. It's something I've used for years in the datacenters I support and I'm not talking about a DNS hack.