This stuff should be in the SDK Common library, not in the powershell specific code.