Add shared functions to module_utils/powershell.ps1 and refactor powershell modules to utilize the common powershell code