updated script for the Powershell module