Function makePowershellScript