Forum Discussion
sam_ekay5
Oct 19, 2021Copper Contributor
PowerShell 7 compatibility with PowerShell 5
Hi just like to ask if a .ps1 file written in PowerShell 7 can work in PowerShell 5 without any major issues?
VasilMichev
Oct 19, 2021MVP
That's way too broader question to be able to give you a specific answer. Depends on the module(s) used, generally speaking. Take a look at the following guidance: https://docs.microsoft.com/en-us/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.1
In most cases, you can get away with the majority of the issues by using the -UseWindowsPowerShell switch.
In most cases, you can get away with the majority of the issues by using the -UseWindowsPowerShell switch.
- sam_ekay5Oct 20, 2021Copper Contributor