Speeding up a Powershell script