The sed calls in this line remove all occurrences of the letter v rather than just the first one: https://github.com/PowerShell/PowerShell/blob/master/tools/installpsh-redhat.sh#L124
This ends up removing the "v" in "preview" of the version number when parsing it to come up with a file download path.
This: sed s/v//g needs to have the global option removed to become sed s/v//