From 38ccf34d042935e009cac788ef9e1d9face72882 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Mon, 11 Sep 2017 21:56:41 +0200 Subject: [PATCH] Changes to xSQLServerSetup - Fixed so integration test does not write warnings when SQLPS module is loaded (issue #798). --- CHANGELOG.md | 2 ++ appveyor.yml | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1b531f774..d3363db23f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ - Fixed so that the integration test renames back the SQLPS module folders if they was renamed by AppVeyor (in the appveyor.yml file). ([issue #774](https://github.com/PowerShell/xFailOverCluster/issues/774)). + - Fixed so integration test does not write warnings when SQLPS module is loaded + ([issue #798](https://github.com/PowerShell/xFailOverCluster/issues/798)). - Changes to xSQLServerAlwaysOnAvailabilityGroup - Change the check of the values entered as parameter for BasicAvailabilityGroup. It is a boolean, hence it was not possible to diff --git a/appveyor.yml b/appveyor.yml index 0de0494779..b199669916 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,7 +30,19 @@ test_script: Write-Verbose ('Renaming ''{0}'' to ''..\{1}''' -f $_, $newFolderName) -Verbose Rename-Item $_ -NewName $newFolderName -Force } - Write-Verbose -Message '---------------------------------' -Verbose + + Write-Verbose -Message '' -Verbose + + # Workaround for issue #798 + Write-Verbose -Message '--- WORKAROUND FOR ISSUE #798 ---' -Verbose + $sqlModules = Get-Module -ListAvailable -Name 'ServiceManagement' + $sqlUniqueModulePath = Split-Path -Path (Split-Path $sqlModules.Path -Parent) -Parent | Sort-Object -Unique + $sqlUniqueModulePath | ForEach-Object -Process { + $newFolderName = '{0}.old' -f (Split-Path -Path $_ -Leaf) + Write-Verbose ('Renaming ''{0}'' to ''..\{1}''' -f $_, $newFolderName) -Verbose + Rename-Item $_ -NewName $newFolderName -Force + } + Write-Verbose -Message '' -Verbose Invoke-AppveyorTestScriptTask -CodeCoverage -CodeCovIo -ExcludeTag @() -RunTestInOrder