Easy, don't use global variables!
Although, if you must, you can suppress PSSA warnings with SuppressMessageAttribute
:
function RunSecund(){
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUserDeclaredVarsMoreThanAssignments', '', Scope='Function')]
$global:ProjectName = "a name"
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…