If I connect with New-PSSession to a target that gets redirected, for example:
New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ `
-Credential $Cred -Authentication Basic -AllowRedirection
I receive the message:
WARNING: Your connection has been redirected to the following URI:
The string in quotes includes a NULL character before the closing quote.
This can cause problems if I am recording a transcript of the session which I then wish to mail out. Since nulls should not be in the body of a mail message (some mailers truncate the message at the null, others fail to see the message completely).