Skip to content
This repository was archived by the owner on Nov 10, 2017. It is now read-only.

Commit 0a0ec23

Browse files
committed
Fixed issue #2
1 parent 504446c commit 0a0ec23

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Sitecore.Azure/Sitecore.Azure.psm1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ function Export-SitecoreAzureSqlDatabase
5858
# The disk directory path where the *.bacpac file will be written.
5959
$outputDirectory = New-Item -ItemType Directory -Path $tempPath -Name "Sitecore\BACPAC\" -Force
6060

61-
# For more information about the SqlPackage.exe utility, see the MSDN web site
62-
# https://msdn.microsoft.com/en-us/library/hh550080%28v=vs.103%29.aspx
63-
$sqlpackageExe = "C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin\sqlpackage.exe"
61+
# For more information about the SqlPackage.exe utility, see the MSDN web site https://msdn.microsoft.com/en-us/library/hh550080%28v=vs.103%29.aspx
62+
Import-Module sqlps -DisableNameChecking
63+
$sqlServerVersion = (Get-Item -Path ("SQLSERVER:\SQL\{0}" -f $SqlServerName)).Version
64+
$sqlpackageExe = "{0}\Microsoft SQL Server\{1}{2}\DAC\bin\sqlpackage.exe" -f ${env:ProgramFiles(x86)}, $sqlServerVersion.Major, $sqlServerVersion.Minor
6465

6566
foreach ($databaseName in $sqlServerDatabaseList)
6667
{

0 commit comments

Comments
 (0)