これで十分
#Requires -Version 5
if ($PSVersionTable.PSEdition -eq 'Core') {
throw 'Powershell Coreでは動作しません。'
}