diff --git a/azure/pipelines/deploy/sql-script.yml b/azure/pipelines/deploy/sql-script.yml index 3b06f9a..2b2b251 100644 --- a/azure/pipelines/deploy/sql-script.yml +++ b/azure/pipelines/deploy/sql-script.yml @@ -92,8 +92,10 @@ steps: inputs: targetType: inline script: | - # Invoke-Sqlcmd is typically available on hosted build agent. - # Install-Module -Name SqlServer -AllowPrerelease -Force -Verbose -Scope CurrentUser + # Invoke-Sqlcmd is typically available on Windows hosted build agent, but not on Linux. + If (-Not (Get-Module SqlServer -ListAvailable)) { + Install-Module -Name SqlServer -AllowPrerelease -Force -Verbose -Scope CurrentUser + } $scriptPath = Split-Path -Path "${{ parameters.script }}" Set-Location $scriptPath