Use .pwsh instead of .ps1 extension for PowerShell Core scripts?
Add a line
#requires -PSEdition Core
at the beginning of your scripts for PowerShell Core, and a line
#requires -PSEdition Desktop
at the beginning of your scripts for regular PowerShell.
For scripts that run in both editions just omit the line.
From the documentation:
-PSEdition <PSEdition-Name>
Specifies a PowerShell edition that the script requires. Valid values are Core for PowerShell Core and Desktop for Windows PowerShell.
Do not use different extensions, as that will impact functionality. For instance, PowerShell will not dot-source scripts with an extension other than .ps1.