
function Update-GetPC {
    if ($devStage -eq "Prod") {
        $null = $getPCProdBuildPath -match '(.*)\\Get-PC.psd1'
        $GetPCSourcePath = $Matches[1]
    }
    elseif ($devStage -eq "Dev") {
        $null = $getPCDevBuildPath -match '(.*)\\Get-PC.psd1'
        $GetPCSourcePath = $Matches[1]
    }
    $desinationPath = ($env:PSModulePath -split ';')[0] + "\Get-PC"

    Write-Host "Updating Get-PC..."
    Robocopy.exe $GetPCSourcePath $desinationPath /mir | Out-Null

    if($LASTEXITCODE -gt 7){
        Write-Warning 'An error has occured during update. Please restart powershell and try again'
    }
    else{
        Write-Host 'Update Complete: Please Restart Powershell' -ForegroundColor Green
    }
    
}