chaliy/psget — pull request #17 by tobinjones (2012-02-13 00:06:55+00:00)
Title: Fix for #16 Compatibility with Powershell 3

Hi,

This fixes the issue I raised. It's to do with the fact that "TabExpansion" has changed in Powershell 3.

This commit checks for existence before backing up, restoring, or calling TabExpansion function. I appreciate that Powershell 3 is still only CTP2, so liable to change, so I've fixed the issue without relying on anything Powershell 3, it just does sanity checks.

In the process, the backup/restore code is also simplified, currently the TabExpansion function is backed up in both the $teBackup function and also the $OldTabExpansion variable. Now, only the $teBackup method is used.

Cheers!