Skip to content

Instantly share code, notes, and snippets.

@alexrgreenwood
Created June 25, 2024 11:26
Show Gist options
  • Save alexrgreenwood/afdb19382d0b7bf45db5ad20f646e97e to your computer and use it in GitHub Desktop.
Save alexrgreenwood/afdb19382d0b7bf45db5ad20f646e97e to your computer and use it in GitHub Desktop.
Download and launch latest PSU 5 beta
$zipname = 'universal_auto.zip'
$foldername = 'UniversalApp'
$data_url = 'https://imsreleases.blob.core.windows.net/universal-nightly?restype=container&comp=list'
$do_download = $false #move this down if you have the latest zip downloaded in this directory already
$do_download = $true
if ($do_download -eq $true){
[xml]$Builds = (Invoke-WebRequest $data_url).Content.Substring(1)
$Latest = $Builds.EnumerationResults.Blobs.Blob |
Where-Object {$_.Name -like "*Universal.win-x64.5.0.0-beta*" -and $_.Name -like "*.zip"} |
ForEach-Object {
[PSCustomObject]@{
Url = $_.Url
LastModified = [DateTime]$_.Properties['Last-Modified'].'#text'
}
} | Sort-Object LastModified -Descending | Select-Object -First 1
Write-Debug "Downloading > $($Latest.Url)" -Debug
Write-Debug "LastModified: $($Latest.LastModified)" -Debug
try {
Remove-Item .\$zipname -Force -Verbose -ErrorAction Continue
Invoke-WebRequest -Uri $($Latest.Url) -outfile .\$zipname -Verbose
Remove-Item .\$foldername -Recurse -Confirm:$false
}
catch{throw _$}
Expand-Archive $zipname -DestinationPath .\$foldername
Get-ChildItem .\$foldername -Recurse | Unblock-File
}
Remove-Item .\Logs\*.txt
$psu_env = @{
NodeName = 'alex'
SystemLogLevel = 'Information'
SystemLogPath = '.\Logs\SystemLog.txt'
Plugins__0 = 'PostgreSQL'
Data__ConnectionString = 'Host=localhost; Database=PSUv5b7; User Id=pguser; Password=PGPassword1!;Port=5432'
Data__RepositoryPath = '.\Repository'
}
Start-Process .\$foldername\Universal.Server.exe -Environment $psu_env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment