Skip to content

Commit

Permalink
Fixing PSUseParameterNameDeclaredCasing warnings in Import-BacpacToSq…
Browse files Browse the repository at this point in the history
…lServer, which is also a fix for the parameter's value being reset at the beginning
  • Loading branch information
BenedekFarkas committed Jun 12, 2024
1 parent ed13b86 commit 014d729
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions SqlServer/Import-BacpacToSqlServer/Import-BacpacToSqlServer.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ function Import-BacpacToSqlServer
Process
{
# Setting up SQL Package executable path.
$sqlPackageExecutablePath = ''
$finalSqlPackageExecutablePath = ''
if (-not [string]::IsNullOrEmpty($SqlPackageExecutablePath) -and (Test-Path $SqlPackageExecutablePath))
{
$sqlPackageExecutablePath = $SqlPackageExecutablePath
$finalSqlPackageExecutablePath = $SqlPackageExecutablePath
}
else
{
Expand All @@ -107,12 +107,12 @@ function Import-BacpacToSqlServer

if ([string]::IsNullOrWhiteSpace($locatedPath))
{
$sqlPackageExecutablePath = $defaultSqlPackageExecutablePath
Write-Verbose "SQL Package executable for importing the database found at '$sqlPackageExecutablePath'!"
$finalSqlPackageExecutablePath = $defaultSqlPackageExecutablePath
Write-Verbose "SQL Package executable for importing the database found at '$finalSqlPackageExecutablePath'!"
}
}

if ([string]::IsNullOrEmpty($sqlPackageExecutablePath))
if ([string]::IsNullOrEmpty($finalSqlPackageExecutablePath))
{
throw ('No SQL Package executable found for importing the database! You can download it from' +
' "https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download"!')
Expand Down Expand Up @@ -231,7 +231,7 @@ function Import-BacpacToSqlServer
}

# And now we get to actually importing the database after setting up all the necessary parameters.
& "$sqlPackageExecutablePath" @parameters
& "$finalSqlPackageExecutablePath" @parameters



Expand Down

0 comments on commit 014d729

Please sign in to comment.