How can we help you today? How can we help you today?
PeterDaniels
I think I found the answer here: https://documentation.red-gate.com/sca3/getting-started/requirements/powershell-component-requirements  Apparently linux Jenkins nodes won't fly. / comments
I think I found the answer here: https://documentation.red-gate.com/sca3/getting-started/requirements/powershell-component-requirements Apparently linux Jenkins nodes won't fly.
0 votes
I did, @Monday. Here's the function: $VersionInfo = Get-LatestVersionAndMigrationNumber -ProjectFilePath $ProjectFilePath $PackageVersion = $VersionInfo.Version + '-migration' + $VersionInfo.MigrationNumber $ReleaseVersion = $PackageVersion </code># Get latest version and migration from project file path # This is cool. Version like 1.1.0 and Migration number like 5 - to build ReleaseVersion and/or PackageVersion function Get-LatestVersionAndMigrationNumber { [CmdletBinding()] param ( [parameter(Mandatory=$true)] [string] $ProjectFilePath ) process { # First, strip the project file name and find the Migrations folder $ProjectRootFolder = Split-Path -Path $ProjectFilePath $MigrationsFolder = Join-Path -Path $ProjectRootFolder -ChildPath "Migrations" if (-not (Test-Path -Path $MigrationsFolder)) { Write-Error -Message "Invalid path: $MigrationsFolder" exit } # Get the latest migration folder sem ver [string]$Latest = Get-ChildItem -Path $MigrationsFolder -Directory | ForEach-Object {[Version]($_.Name -split "-")[0]} | Sort-Object -Descending | Select -First 1 # Get the base folder back now that I found the latest version: $LatestFolder = Get-ChildItem -Path $MigrationsFolder -Directory | Where-Object {$_.Name -like "$Latest*"} # Now get the migrations in that folder $LatestMigrationsFolder = Join-Path -Path $MigrationsFolder -ChildPath $LatestFolder $LatestMigration = (Get-ChildItem -Path $LatestMigrationsFolder -File).Name | Sort-Object -Descending | select -First 1 [int]$LatestMigrationSequenceNumber = ($LatestMigration -split "_")[0] # Return a custom object with the latest sem version and migration sequence num #$Latest + "-migration" + $LatestMigrationSequenceNumber $obj = New-Object -TypeName PSCustomObject -Property @{Version = $Latest;MigrationNumber = $LatestMigrationSequenceNumber} $obj } } </pre><div>I then use it:<br><pre class="CodeBlock"><code>To create a version that looks like (for example) 1.1.0-migration14 / comments
I did, @Monday. Here's the function:$VersionInfo = Get-LatestVersionAndMigrationNumber -ProjectFilePath $ProjectFilePath $PackageVersion = $VersionInfo.Version + '-migration' + $VersionInfo.Migrati...
0 votes