Powershell v5 Import-PSSession problem

I am testing windows 10 and PowerShell v5. I am experiencing a problem when I run an Import-PSSession to Office 365.

$LiveCred=Get-Credential  #Cloud credentials

$ex = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/  -Credential $LiveCred -Authentication basic -AllowRedirection
Import-PSSession $ex -Prefix 

PowerShell freezes after the commando “$ ex = New-PSSession etc.” I get “Warning: Your connection Has been redirected etc” but then it stops.
Nothing more happens. I’ve tried to break it up and run line by line, but still the same error, PowerShell freezes.

This applies regardless of where I run the command, PowerShell, PowerShell ISE, PowerShell Studio. I have to close PowerShell after this.

Could it be a Windows 10 bug, or it could be something else.

I would check opening connection towards Office 365 website using command “netstat -ano | findstr SYN” or just “netstat -ano”.


I don’t believe this is a bug in Windows 10, but Office 365 does not officially support Powershell 5. When you attempt to set up this connection you can see in the text of the warning the Powershell version number as part of the endpoint URL. The Exchange server on the other end most likely does not have powershell 5.0 installed and thus cannot create a version 5.0 endpoint.

At least I think this is what is happening.:wink:

I haven’t heard any word on when O365 will get official version 5.0 support, but hopefully it will be ready at release for Windows 10.

Yes, I think you’re on to something here Matt. It may be the problem. I will take a closer look at this.
Thank you for your response.

I believe there are some known problems with PS Remoting compatibility between PSv5 and the older versions as of the latest previews, as well; this could very well affect O365. Those will be sorted out before the release, but you may still find that certain products are not compatible right away. (The usual suspects: Exchange / O365, SharePoint, etc.)