Fix script for older version of Powershell.