Apr 19 2022 08:31 AM
Hi Everyone,
I was using my local laptop to connect to domain controller with PowerShell through Enter-Pssesion.
After connecting to it, When I am checking the power shell version for my remote computer which is my domain controller, it is showing version 1.0.0.0.0 and when I am checking it locally it is showing version 5.1.0. I am new to PowerShell. Can somebody help me to understand this
This is when I am checking PowerShell version on my dc locally.
And this is when I am connecting this dc from a another machine through PowerShell.
Apr 19 2022 10:08 AM - edited Apr 19 2022 10:10 AM
You should use $PSVersionTable :
[W2K22DC]: PS C:\Users\Administrator\Documents> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.20348.320
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.20348.320
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
This matches the data if you run it locally:
PS C:\Users\Administrator> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.20348.320
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.20348.320
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
In a enter-pssession "get-host | Select-Object version" gives this:
Version
-------
1.0.0.0
and $host.Version gives this:
Major Minor Build Revision
----- ----- ----- --------
1 0 0 0
Apr 20 2022 09:10 PM
Apr 20 2022 09:50 PM - edited May 14 2022 03:17 AM
Get-Host returns information about your powershell session like if you started it from the Start Menu, in a remote pssession that isn't really correct because you're starting point is the session from your computer. I think it displays a value for compatibility reasons? Please mark my answer as solution to mark it as solved.
Feb 06 2023 10:05 AM - edited Feb 06 2023 10:27 AM
I have a similar question! I have recently noticed that Microsoft Update is now automatically updating Powershell which is currently 7.4! Which seemed to work without any errors that I could notice.
But, when I checked the version two different ways, I got Two different versions as well!
If I access Powershell through the Start Menu it shows that the version is 7.4!
If I access Powershell by pressing the Windows Key & the X Key, Powershell recommends a pscore6 Update!
Also, please note that both
Powershell MODES are (ADMINISTRATION).
Feb 06 2023 10:12 AM
Feb 06 2023 10:44 AM
Feb 06 2023 03:28 PM
Feb 07 2023 12:42 AM
Feb 07 2023 12:51 AM
Feb 13 2023 08:54 AM - edited Feb 13 2023 09:01 AM
So how do I update Powershell 5 to pscore6 as is recommended when it's first started? Also, after checking https//aka.ms/pscore6, I discovered that pscore6 is (Out of Support) as indicated on https://learn.microsoft.com/en-us/previous-versions/powershell/scripting/overview?view=powershell-7..... So is it possible to update 5 to a more recent version that is still supported? & if not how can you eliminate the upgrade recommendation in Powershell 5?
Feb 13 2023 08:59 AM