Powershell Replace Text In Array Python Memory Allocation Failure