Search code examples
powershellpowershell-remotingpowershell-5.0powershell-core

PowershellCore connection to a Powershell 5.1 remote computer?


I want to know if it's possible to start from a Powershell 6/7 Host a Remote session on a host that only has Powershell 5.1 installed (that way I can access some Powershell 5.1 functions that can't be migrated to Powershell 6/7) ?

Regards,


Solution

  • To explicitly target a Windows PowerShell session (versions up to v5.1) on a remote computer, use
    -ConfigurationName Microsoft.Powershell with Invoke-Command, for instance.

    In fact, as of PowerShell 7.1, this is still the default version that PowerShell remoting commands target, as reflected in preference variable $PSSessionConfigurationName.

    See this post for more information.