Upgrade from PowerShell 2, 3, 4 to 5.1

This topic contains 2 replies, has 2 voices, and was last updated by  Julien Nury 3 months, 1 week ago.

  • Author
  • #98614

    Julien Nury

    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,

  • #98616

    Joel Sallow

    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

    Julien Nury

    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.

You must be logged in to reply to this topic.