Redgate Flyway

Flyway PowerShell Executable Setting

Description

The PowerShell executable used for running PowerShell script migrations (.ps1 files).

Type

String

Default

"powershell" on Windows, "pwsh" on other platforms

Usage

Flyway Desktop

This can't be configured via Flyway Desktop, although it will be honoured.

Command-line

./flyway -powershellExecutable="pwsh" migrate

TOML Configuration File

[flyway]
powershellExecutable = "pwsh"

Environment Variable

export FLYWAY_POWERSHELL_EXECUTABLE=pwsh

API

Flyway.configure()
    .powershellExecutable("pwsh")
    .load()

Gradle

flyway {
    powershellExecutable = 'pwsh'
}

Maven

<configuration>
    <powershellExecutable>pwsh</powershellExecutable>
</configuration>

Notes

  • PowerShell Core: Use pwsh to use PowerShell 7+ - works consistently across Windows, Linux, and macOS
  • Windows PowerShell 5.1: Use powershell for legacy Windows PowerShell
  • CI/CD Environments: Use pwsh for consistent PowerShell version across different environments

Didn't find what you were looking for?