Write-Diagnostic was inaccessible so created CheckIfPrBuild function and executed later