# Remediation

# path to the directory that TNS_ADMIN should point towards
# Make sure its the same in both the remediation and discovery scripts
$value = "\\ccx.carecentrix.com\public\oracle"

try {

    # create the TNS_ADMIN directory if it doesn't exist
    if ( (Test-Path -Path $value) -eq $false ) {
        New-Item -Path $value -ItemType Directory
    }

    # set the variables
    [System.Environment]::SetEnvironmentVariable('TNS_ADMIN','\\ccx.carecentrix.com\public\oracle','Machine')

    Write-Host "TNS_ADMIN Machine variables Changed"
    exit 0
}
catch {
    $errMsg = $_.Exception.Message
    Write-Host $errMsg
    exit 1 
}