Beta_cartrigesg_bd Beta v0.1

This commit is contained in:
2026-07-25 16:41:27 +03:00
parent d8cee567d7
commit 86e8e60ed2
13 changed files with 1122 additions and 29 deletions

View File

@@ -0,0 +1,31 @@
[CmdletBinding()]
param(
[string]$Version = '18.4-1',
[string]$Destination = (Join-Path $PSScriptRoot 'prerequisites\postgresql-18-windows-x64.exe')
)
$ErrorActionPreference = 'Stop'
$destinationDirectory = Split-Path -Parent $Destination
New-Item -ItemType Directory -Path $destinationDirectory -Force | Out-Null
$url = "https://get.enterprisedb.com/postgresql/postgresql-$Version-windows-x64.exe"
$temporaryFile = "$Destination.download"
Write-Host "Downloading PostgreSQL $Version from $url"
Invoke-WebRequest -Uri $url -OutFile $temporaryFile -UseBasicParsing
$signature = Get-AuthenticodeSignature -FilePath $temporaryFile
if ($signature.Status -ne 'Valid') {
Remove-Item -LiteralPath $temporaryFile -Force -ErrorAction SilentlyContinue
throw "PostgreSQL installer signature is not valid: $($signature.Status)"
}
if ($signature.SignerCertificate.Subject -notmatch 'EnterpriseDB|EDB') {
Remove-Item -LiteralPath $temporaryFile -Force -ErrorAction SilentlyContinue
throw "Unexpected PostgreSQL installer signer: $($signature.SignerCertificate.Subject)"
}
Move-Item -LiteralPath $temporaryFile -Destination $Destination -Force
$hash = Get-FileHash -LiteralPath $Destination -Algorithm SHA256
Write-Host "Saved: $Destination"
Write-Host "SHA256: $($hash.Hash)"