How to use WinRM with PowerShell Core

Hi everyone,

When I remote into a windows machine via WINRM, I found it on remote machine it runs windows powershell rather than windows powershell core by checking the $PSVersionTable. how to change it to the core version? looks like it need to change the endpoint (what’s it? ip+port+executable?), is there a quick way to change it?

[XXXvm01]: PS C:\Users\XXX\Documents> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.3693
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.3693
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

BR

You have to specify the configuration you want to connect to. If it’s not available, run Enable-PSRemoting in the version of PowerShell you want to connect to on the remote machine first.

PS E:\Temp> $session = New-PSSession -ComputerName localhost -ConfigurationName PowerShell.7
PS E:\Temp> Enter-PSSession $session

[localhost]: PS E:\> $PSVersionTable | Select PSVersion

PSVersion
---------
7.3.9

[localhost]: PS E:\> Get-Uptime | Select-Object Days

Days
----
   2
1 Like