PowerShell 7 compatibility with PowerShell 5

%3CLINGO-SUB%20id%3D%22lingo-sub-2860062%22%20slang%3D%22en-US%22%3EPowerShell%207%20compatibility%20with%20PowerShell%205%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2860062%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20just%20like%20to%20ask%20if%20a%20.ps1%20file%20written%20in%20PowerShell%207%20can%20work%20in%20PowerShell%205%20without%20any%20major%20issues%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2860062%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Hi just like to ask if a .ps1 file written in PowerShell 7 can work in PowerShell 5 without any major issues?

2 Replies
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...
In most cases, you can get away with the majority of the issues by using the -UseWindowsPowerShell switch.

@Vasil Michev 

 

Thanks for your answer and help on this.

 

Ok, will see and try things out first then