Powershell Variable Scope In Function Python Code