Get-WindowsFeature but with Powershell Version 2

Welcome Forums General PowerShell Q&A Get-WindowsFeature but with Powershell Version 2

Viewing 4 reply threads
  • Author
    Posts
    • #246795
      Participant
      Topics: 5
      Replies: 9
      Points: 68
      Rank: Member

      Hello!
      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.

      • This topic was modified 1 month, 2 weeks ago by izShell57.
    • #246801
      Participant
      Topics: 7
      Replies: 2458
      Points: 6,439
      Helping Hand
      Rank: Community MVP

      Isaac,
      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.

    • #246804
      Participant
      Topics: 7
      Replies: 557
      Points: 2,122
      Helping Hand
      Rank: Community Hero

      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.

      https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/enable-or-disable-windows-features-using-dism

      • #246825
        Participant
        Topics: 5
        Replies: 9
        Points: 68
        Rank: Member

        Thank you!
        I appreciate your help!

    • #246834
      Senior Moderator
      Topics: 10
      Replies: 161
      Points: 871
      Helping Hand
      Rank: Major Contributor

      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.

    • #246843
      Participant
      Topics: 5
      Replies: 9
      Points: 68
      Rank: Member

      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”.

      • #246846
        Senior Moderator
        Topics: 10
        Replies: 161
        Points: 871
        Helping Hand
        Rank: Major Contributor

        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.

        • This reply was modified 1 month, 2 weeks ago by grokkit.
Viewing 4 reply threads
  • You must be logged in to reply to this topic.