Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"version": {
"Major": 1,
"Minor": 5,
"Patch": 0
"Patch": 1
},
"demands": [
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"version": {
"Major": 2,
"Minor": 2,
"Patch": 0
"Patch": 1
},
"demands": [
],
Expand Down
2 changes: 1 addition & 1 deletion Extensions/IISWebAppDeploy/Src/vss-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifestVersion": 1,
"extensionId": "iiswebapp",
"name": "IIS Web App Deployment Using WinRM",
"version": "1.7.0",
"version": "1.7.1",
"publisher": "ms-vscs-rm",
"description": "Using WinRM connect to the host Computer, to deploy a Web project using Web Deploy or a SQL DB using sqlpackage.exe.",
"public": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,15 @@ function LocateSqlPackageFromVSInstallationRoot {
$sqlDacRoot = [System.IO.Path]::Combine($VSInstallRoot, "Extensions", "Microsoft", "SQLDB", "DAC")

if (Test-Path $sqlDacRoot) {
$dacVersion = GetDacFxMajorVersion $sqlDacRoot
$dacFullPath = [System.IO.Path]::Combine($sqlDacRoot, "SqlPackage.exe")

if(Test-Path $dacFullPath -pathtype leaf)
{
Write-Verbose "Dac Framework installed with Visual Studio found at $dacFullPath on machine $env:COMPUTERNAME"
return $dacFullPath, $dacVersion
}

$sqlDacLocations = Get-ChildItem $sqlDacRoot | Sort-Object @{e={$_.Name -as [int]}} -Descending

foreach ($sqlDacLocation in $sqlDacLocations)
Expand All @@ -340,6 +349,37 @@ function LocateSqlPackageFromVSInstallationRoot {
return $null, 0
}

function GetDacFxMajorVersion {
[CmdletBinding()]
Param (
[string] $path
)
try {
$file = [System.IO.Path]::Combine($sqlDacRoot, "Microsoft.SqlServer.Dac.dll")

Write-Verbose "Getting version info for file $file."

if (Test-Path -LiteralPath $file -PathType 'Leaf') {

$fileVersionInfo = (Get-Command -Name $file -ErrorAction 'Stop').FileVersionInfo
$fileVersion = $fileVersionInfo.FileVersion

if ($fileVersion) {
$version = [version]$fileVersion
Write-Verbose "Major product version is $($version.Major)."
return $version.Major
}

return 0
}
}
catch {
Write-Verbose "Failed to get version info for $file"

return 0
}
}

function LocateSqlPackageInVS([string] $version)
{
$vsRegKeyForVersion = "SOFTWARE", "Microsoft", "VisualStudio", $version -join [System.IO.Path]::DirectorySeparatorChar
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = 'TaskModuleSqlUtility.psm1'
ModuleVersion = '0.1.3'
ModuleVersion = '0.1.4'
GUID = 'd997c6dd-33ad-481c-859b-01120229b91f'
Author = 'Microsoft'
CompanyName = 'Microsoft'
Expand Down