Powershell While Loop Array Python Definition Function