Wednesday, June 4, 2014

#12 : How to know Powershell Version?

People often ask me how to find the Powershell version. The questions might be like -
How to find the Powershell version?
What version of Powershell I am using?
Is there any way to find Powershell version?

Stop! I am telling you. This is just a small command -
  1. clear   
  2. $Host.Version  
Output: 
Major Minor Build Revision
----- ----- ----- --------
2      2    0     1358


Again, there should no more doubts, Major is the one which you have to look. Ok, let me simplify it.

  1. clear   
  2. $Host.Version | foreach { "Powershell " + $_.Major + ".0" }   
Output:
Powershell 2.0 

 
There should not be any doubts now :).

1 comment:

#112: How to handle xml document in Powershell?

 In PowerShell, you can handle XML data using various cmdlets and methods provided by the .NET Framework. Here's a basic guide on how to...