Skip to content

Commit

Permalink
Changes to SqlSetup
Browse files Browse the repository at this point in the history
- Now the correct assembly should load when using the helper function
  Connect-SQLAnalysis. Previously is was using LoadWithPartialName() which
  meant that it would load the first assembly in GAC, regardless of which
  PowerShell module was used (SQLPS or SqlSever).
  • Loading branch information
johlju committed Jul 30, 2018
1 parent 6d42512 commit 86e076f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

- Changes to SqlSetup
- Now the correct assembly should load when using the helper function
Connect-SQLAnalysis. Previously is was using LoadWithPartialName() which
meant that it would load the first assembly in GAC, regardless of which
PowerShell module was used (SQLPS or SqlSever).

## 11.4.0.0

- Changes to SqlServerDsc
Expand Down
2 changes: 1 addition & 1 deletion SqlServerDscHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function Connect-SQLAnalysis
$SetupCredential
)

$null = [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.AnalysisServices')
Import-SQLPSModule

if ($SQLInstanceName -eq 'MSSQLSERVER')
{
Expand Down
4 changes: 4 additions & 0 deletions Tests/Unit/SqlServerDSCHelper.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,10 @@ InModuleScope $script:moduleName {
}

Describe 'Testing Connect-SQLAnalysis' {
BeforeAll {
Mock -CommandName Import-SQLPSModule
}

BeforeEach {
Mock -CommandName New-InvalidOperationException -MockWith $mockThrowLocalizedMessage -Verifiable
Mock -CommandName New-Object `
Expand Down

0 comments on commit 86e076f

Please sign in to comment.