$global:ProjectName = $null
function RunFirst(){
RunSecund
Write-Host $global:ProjectName
}
function RunSecund(){
$global:ProjectName = "a name"
}
In RunSecund I get:
See Question&Answers more detail:osThe variable 'ProjectName' is assigned but never used. PSScriptAnalyzer(PSUseDeclaredVarsMoreThanAssignments)