<commit_before># CheckNpgsqlStatus by kenjiuno
# Runs great on Package Manager Console in Visual Studio 2013

# (new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/kenjiuno/CheckNpgsqlSetupStatus/master/CheckNpgsqlStatus.ps1") | iex

# [System.IO.File]::ReadAllText("H:\Proj\CheckNpgsqlSetupStatus\CheckNpgsqlStatus.ps1")|iex; CheckNpgsqlStatus

function GetProjectProperty
{
    param (
        $project,
        [string] $propertyName,
        [string] $defaultValue
    )
    $ConfigurationManager = $project.ConfigurationManager
    if ($ConfigurationManager) {
        $ActiveConfiguration = $ConfigurationManager.ActiveConfiguration
        if ($ActiveConfiguration) {
            $Properties = $ActiveConfiguration.Properties
            if ($Properties) {
                try {
                    $propertyItem = $Properties.Item($propertyName)
                    if ($propertyItem) {
                        return $propertyItem.Value
                    }
                }
                catch [ArgumentException] {
                    # property not found
                }
            }
        }
    }
    $Properties = $project.Properties
    if ($Properties) {
        try {
            for ($index = 1; $index -le $Properties.Count; $index++) {
                $propertyItem = $Properties[$index]
                if ($propertyItem.Name -ieq $propertyName) {
                    return $propertyItem.Value
                }
            }
        }
        catch [ArgumentException] {
            # property not found
        }
    }
    return $defaultValue
}

function CheckNpgsqlStatus
{
    Write-Host "## DbProviderFactories.GetFactoryClasses" -ForegroundColor Green
    Write-Host "``````" -ForegroundColor DarkGreen
    [System.Data.Common.DbProviderFactories]::GetFactoryClasses() | Out-String -Stream | Write-Host -ForegroundColor DarkGreen
    Write-Host "``````" -ForegroundColor DarkGreen
    
    Write-Host "## GetSection system.data/DbProviderFactories" -ForegroundColor Green
    Write-Host "``````" -ForegroundColor DarkGreen
    [System.Configuration.ConfigurationManager]::GetSection("system.data").Tables["DbProviderFactories"] | Out-String -Stream | Write-Host -ForegroundColor DarkGreen
    Write-Host "``````" -ForegroundColor DarkGreen

    Write-Host "## Npgsql from DbProviderFactories.GetFactory" -ForegroundColor Green
    try {
        $npgsqlAssembly = [System.Data.Common.DbProviderFactories]::GetFactory("Npgsql").GetType().Assembly
        Write-Host " " $npgsqlAssembly.FullName -ForegroundColor DarkGreen
        Write-Host " " $npgsqlAssembly.Location -ForegroundColor DarkGreen
    }
    catch [Exception] {
        Write-Host " " "Not available!" -ForegroundColor Red
    }

    Write-Host "## Npgsql in active project" -ForegroundColor Green
    $found = $false<commit_msg>More info.<commit_after># CheckNpgsqlStatus by kenjiuno
# Runs great on Package Manager Console in Visual Studio 2013

# (new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/kenjiuno/CheckNpgsqlSetupStatus/master/CheckNpgsqlStatus.ps1") | iex

# [System.IO.File]::ReadAllText("H:\Proj\CheckNpgsqlSetupStatus\CheckNpgsqlStatus.ps1")|iex; CheckNpgsqlStatus

function GetProjectProperty
{
    param (
        $project,
        [string] $propertyName,
        [string] $defaultValue
    )
    $ConfigurationManager = $project.ConfigurationManager
    if ($ConfigurationManager) {
        $ActiveConfiguration = $ConfigurationManager.ActiveConfiguration
        if ($ActiveConfiguration) {
            $Properties = $ActiveConfiguration.Properties
            if ($Properties) {
                try {
                    $propertyItem = $Properties.Item($propertyName)
                    if ($propertyItem) {
                        return $propertyItem.Value
                    }
                }
                catch [ArgumentException] {
                    # property not found
                }
            }
        }
    }
    $Properties = $project.Properties
    if ($Properties) {
        try {
            for ($index = 1; $index -le $Properties.Count; $index++) {
                $propertyItem = $Properties[$index]
                if ($propertyItem.Name -ieq $propertyName) {
                    return $propertyItem.Value
                }
            }
        }
        catch [ArgumentException] {
            # property not found
        }
    }
    return $defaultValue
}

function CheckNpgsqlStatus
{
    Write-Host "## Host" -ForegroundColor Green
    $DTE.Name + " " + $DTE.Version + " " + $DTE.Edition | Out-String -Stream | Write-Host -ForegroundColor DarkGreen

    Write-Host "## GetSection system.data/DbProviderFactories" -ForegroundColor Green
    Write-Host "``````" -ForegroundColor DarkGreen
    [System.Configuration.ConfigurationManager]::GetSection("system.data").Tables["DbProviderFactories"] | Out-String -Stream | Write-Host -ForegroundColor DarkGreen
    Write-Host "``````" -ForegroundColor DarkGreen

    Write-Host "## DbProviderFactories.GetFactoryClasses" -ForegroundColor Green
    Write-Host "``````" -ForegroundColor DarkGreen
    [System.Data.Common.DbProviderFactories]::GetFactoryClasses() | Out-String -Stream | Write-Host -ForegroundColor DarkGreen
    Write-Host "``````" -ForegroundColor DarkGreen

    Write-Host "## Npgsql from DbProviderFactories.GetFactory" -ForegroundColor Green
    try {
        $npgsqlAssembly = [System.Data.Common.DbProviderFactories]::GetFactory("Npgsql").GetType().Assembly
        Write-Host " " $npgsqlAssembly.FullName -ForegroundColor DarkGreen
        Write-Host " " $npgsqlAssembly.Location -ForegroundColor DarkGreen
    }
    catch [Exception] {
        Write-Host " " "Not available!" -ForegroundColor Red
    }

    Write-Host "## Npgsql in active project" -ForegroundColor Green
    $found = $false
{'fraction_non_alphanumeric': 0.10819560402112796, 'fraction_numerical': 0.002385414891804396, 'mean_word_length': 2.523409363745498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '729158', 'n_tokens_mistral': 1624, 'n_tokens_neox': 1565, 'n_words': 304}