Powershell Script Loop Through Array Python Memory Allocation