So you updated to Windows 10 Anniversary and now have found yourself unable to connect to a remote PowerShell sessions. I noticed this in my management of Exchange Online in Office 365 after upgrading to Windows 10 version 1607 aka Anniversary Edition.
In my attempts to connect, as I have done in the past: http://jermsmit.com/azure-active-directory-module-for-windows-powershell-how-to-connect/ I encountered a error message:
Import-PSSession : Could not load type ‘System.Management.Automation.SecuritySupport’ from assembly
‘System.Management.Automation, Version=126.96.36.199, Culture=neutral, PublicKeyToken=31bf3856ad364e35’.
At C:\Scripts\Connect-EXO.PS1:6 char:18
+ $ImportResults = Import-PSSession $Session
+ CategoryInfo : NotSpecified: (:) [Import-PSSession], TypeLoadException
+ FullyQualifiedErrorId : System.TypeLoadException,Microsoft.PowerShell.Commands.ImportPSSessionCommand
Later comparing this with my down-level installs of Windows 10 and Server 2012 R2 this issue does not exist. So what changed?
It seems that the version of PowerShell which was updated may have something to do with this issue. This is when I attempted to run PowerShell in a down-level mode.
This is done by issuing the following command in an elevated command prompt (Run As Administrator): PowerShell.exe -Version 2.0
From this point we can now connect without issue.
Hope this helps