Dear, I am a certified Microsoft professional and have extensive experience in both powershell and developing and managing postgresql, I can correct the script you need in a very short time, if you like send me the script, I correct it and then assign me the job once it is finished, as well you go to the safe on finished work, I will be attentive to your comments, kind regards.