Upgrade from PowerShell 2, 3, 4 to 5.1

Welcome Forums General PowerShell Q&A Upgrade from PowerShell 2, 3, 4 to 5.1

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
2 months, 3 weeks ago.

  • Author
    Posts
  • #98614

    Participant
    Points: 0
    Rank: Member

    Hi all,

    As we want to use DSC and JEA on all our servers, we are planning to upgrade all our Windows hosts to PowerShell 5.1. As we have various PowerShell versions and various scripts, we cannot cover all scenarios with tests.

    Is there a list of known commands/patterns that have been deprecated thru the history of PowerShell ?

    Have a nice day,
    Julien

  • #98616

    Participant
    Points: 2
    Rank: Member

    I'm not really aware of anything significant that's been deprecated, really. Far as I've been able to tell, PS is pretty good with backwards compatibility up until you cross the boundary to PS Core 6 — 5.1 should be compatible with basically everything written in earlier versions, to my knowledge.

    Even so, I'd recommend updating them to comply with best practices, regardless. A lot of good coding patterns weren't even possible in PS 2 (e.g., parameter validation, function attributes, proper pipeline handling, etc.)

  • #98652

    Participant
    Points: 0
    Rank: Member

    Thank-you for your message. It's my opinion too but my team keeps telling my creepy stories about old PS scripts dealing with XML and never upgraded nor compatible with newer versions ... but no one knows which script it is.

    So, we plan to upgrade hosts (after a snapshot) and add '-version x' to the powershell.exe command line launching buggy scripts.

  • #105274

    Participant
    Points: 0
    Rank: Member

    Did you ever get the Powershell upgrade completed? I believe I have to upgrade all Win7 32bit and 64bit systems to PowerShell 5.1 from 2.0 before I can complete an Outlook Junk email Phishing add-in install?

You must be logged in to reply to this topic.