Get-WindowsFeature but with Powershell Version 2

I am new with powershell and need to write a script that collects windows features that exist on a machine. I am aware V5 has the command “Get-WindowsFeature”.

However, I have not found the same in V2.
The closest thing I found was “Get-WMIObject Win32_OptionalFeatures”. I have scoured the internet but have been unsuccesful.

Any help would be greatly appreciated!
Thank you in advance.

all Windows version coming with a Powershell version prior 3.0 are not supported anymore. You should not put any effort into Powershell v 2.0.

Like @Olaf said, efforts should be spent on newer versions of powershell. If you are looking for alternatives, DISM can also enable features starting with Windows 8/2012.

Thank you!
I appreciate your help!

To expand on this a bit more, PowerShell 2.0 has been officially deprecated by Microsoft, largely due to a lack of security features. It should not be used in business/production environments. For example, the Department of Defense requires that PowerShell 2.0 not be installed on its computers. If this is for work, you should try to get your company to update because of the risks. If it’s for personal use just be aware that having PowerShell 2.0 installed on your computer creates a risk, regardless of how you use it.

Thank you for your concern!
I appreciate the indepth explanation. However, when the boss says “jump!” then I’m forced to say “how high”…or in this scenario “what version”.

I figured this might be your situation, and it’s not uncommon for businesses to be tied to outdated software for operational reasons. But, after the recent Garmin ransomware debacle, the Marriott data breach, the massive issues surrounding the use of Zoom for teleconferencing, and the rising expense of data breaches, every company should be taking their information security seriously. Attacks are increasing in frequency and in impact. Quite literally, you cannot afford to ignore known vulnerabilities.

The bottom line is, this will cost the company money.

If for some reason you can’t win that argument, then you should at least CYA. Get the instruction in writing, along with a specific acknowledgement of the risk involved. And tell your boss that you’re trying to protect him, too.