Powershell version limitations

One of the things I’ve been playing with recently is using Powershell and command line SQL installs (and a few other bits and pieces) to rebuild parts of the virtual SQL infrastructure.

The idea is that there is a Powershell script somewhere which can simply be run which will install whichever instance is right for that server, using the install files found on the NAS.

Unfortunately, this means in order to work, I’d have to map the directory to a drive, then run the necessary commands locally, which is a great excuse for me to use the New-PSDrive command.

Slight issue - apparently, when parsing in credentials to this function (and it does have a parameter called -Credentials which accepts a ‘Get-Credential’ object [see the link above for more details]) the behind-the-scenes functionality is actually Powershell version specific.

So, if you’re using anything below PS v3, this doesn’t actually work at all.

Now my question is – if it’s not backward compatible, why wasn’t this lack of functionality mentioned in the documentation?

A brief introduction

Hello,

My name is Scott and this is a blog post that’ll probably end up on an about page once I actually get started.

I’m a SQL server DBA/Developer currently working in London and taking my time to do my MCITP for SQL Server (still haven’t decided if I want to change and do the new exams yet).

On here I hope to drop a few bits of possibly handy SQL or Powershell code for you to use – any constructive feedback is always appreciated.

Thanks,
- Scott