Checking the Powershell version is a requirement for an upgrade cycle. How can I programatically extract the Powershell version and create a report . This would allow me to include a check before I execute some code?

Answer: The Powershell version can be extracted from the $PSVersionTable variable. The $PSVersionTable contains other information which I’ve included in this output.