Skip to main content
Fixed spelling of Powershell to "PowerShell", clarified question to ask about a specific mandatory version rather than a specified minimum/maximum allowed version.
Source Link

I have both PowershellPowerShell 5.1 and PowershellPowerShell 7.0 on my computer and I'm try to run a script that has to be run in Powershell 7.0. How do How can I make the script run inenforce a specificmandatory version (a specific version, not a minimum or maximum version #) of PowerShell for a given script (in this case, PowerShell 7.0)?

I have both Powershell 5.1 and Powershell 7.0 on my computer and I'm try to run a script that has to be run in Powershell 7.0. How do I make the script run in a specific version.

I have both PowerShell 5.1 and PowerShell 7.0 on my computer. How can I enforce a mandatory version (a specific version, not a minimum or maximum version #) of PowerShell for a given script (in this case, PowerShell 7.0)?

Source Link

How to force a Powershell Script to run a specific Version

I have both Powershell 5.1 and Powershell 7.0 on my computer and I'm try to run a script that has to be run in Powershell 7.0. How do I make the script run in a specific version.