diff --git a/Diagnostics/HealthChecker/DataCollection/ExchangeInformation/Get-ExchangeInformation.ps1 b/Diagnostics/HealthChecker/DataCollection/ExchangeInformation/Get-ExchangeInformation.ps1 index 2341114bf3..b3885e2053 100644 --- a/Diagnostics/HealthChecker/DataCollection/ExchangeInformation/Get-ExchangeInformation.ps1 +++ b/Diagnostics/HealthChecker/DataCollection/ExchangeInformation/Get-ExchangeInformation.ps1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -. $PSScriptRoot\..\..\..\..\Security\src\ExchangeExtendedProtectionManagement\DataCollection\Get-ExtendedProtectionConfiguration.ps1 +. $PSScriptRoot\..\..\..\..\Shared\Get-ExtendedProtectionConfiguration.ps1 . $PSScriptRoot\..\..\..\..\Shared\ErrorMonitorFunctions.ps1 . $PSScriptRoot\..\..\..\..\Shared\Get-ExchangeBuildVersionInformation.ps1 . $PSScriptRoot\..\..\..\..\Shared\Get-ExchangeSettingOverride.ps1 diff --git a/Security/src/ExchangeExtendedProtectionManagement/ConfigurationAction/Invoke-ConfigureExtendedProtection.ps1 b/Security/src/ExchangeExtendedProtectionManagement/ConfigurationAction/Invoke-ConfigureExtendedProtection.ps1 index 4fb08d0d8f..d77ac26e37 100644 --- a/Security/src/ExchangeExtendedProtectionManagement/ConfigurationAction/Invoke-ConfigureExtendedProtection.ps1 +++ b/Security/src/ExchangeExtendedProtectionManagement/ConfigurationAction/Invoke-ConfigureExtendedProtection.ps1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -. $PSScriptRoot\..\DataCollection\Get-ExtendedProtectionConfiguration.ps1 +. $PSScriptRoot\..\..\..\..\Shared\Get-ExtendedProtectionConfiguration.ps1 . $PSScriptRoot\..\..\..\..\Shared\Invoke-ScriptBlockHandler.ps1 . $PSScriptRoot\..\..\..\..\Shared\Write-ErrorInformation.ps1 diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Get-ExtendedProtectionPrerequisitesCheck.ps1 b/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Get-ExtendedProtectionPrerequisitesCheck.ps1 index a2b4a582cd..c4d917fce6 100644 --- a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Get-ExtendedProtectionPrerequisitesCheck.ps1 +++ b/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Get-ExtendedProtectionPrerequisitesCheck.ps1 @@ -2,7 +2,7 @@ # Licensed under the MIT License. . $PSScriptRoot\..\..\..\..\Shared\TLS\Get-AllTlsSettings.ps1 -. $PSScriptRoot\Get-ExtendedProtectionConfiguration.ps1 +. $PSScriptRoot\..\..\..\..\Shared\Get-ExtendedProtectionConfiguration.ps1 # This function is used to collect the required information needed to determine if a server is ready for Extended Protection function Get-ExtendedProtectionPrerequisitesCheck { diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Get-ExtendedProtectionConfiguration.ps1 b/Shared/Get-ExtendedProtectionConfiguration.ps1 similarity index 99% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Get-ExtendedProtectionConfiguration.ps1 rename to Shared/Get-ExtendedProtectionConfiguration.ps1 index 19005fdc44..807fe41fbe 100644 --- a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Get-ExtendedProtectionConfiguration.ps1 +++ b/Shared/Get-ExtendedProtectionConfiguration.ps1 @@ -1,9 +1,9 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -. $PSScriptRoot\..\..\..\..\Shared\Invoke-CatchActionError.ps1 -. $PSScriptRoot\..\..\..\..\Shared\Invoke-ScriptBlockHandler.ps1 -. $PSScriptRoot\..\..\..\..\Shared\Write-ErrorInformation.ps1 +. $PSScriptRoot\Invoke-CatchActionError.ps1 +. $PSScriptRoot\Invoke-ScriptBlockHandler.ps1 +. $PSScriptRoot\Write-ErrorInformation.ps1 function Get-ExtendedProtectionConfiguration { [CmdletBinding()] diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E15_Configured_Both_ApplicationHost.config b/Shared/Tests/ExtendedProtection/Data/E15_Configured_Both_ApplicationHost.config similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E15_Configured_Both_ApplicationHost.config rename to Shared/Tests/ExtendedProtection/Data/E15_Configured_Both_ApplicationHost.config diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E15_Configured_Cas_ApplicationHost.config b/Shared/Tests/ExtendedProtection/Data/E15_Configured_Cas_ApplicationHost.config similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E15_Configured_Cas_ApplicationHost.config rename to Shared/Tests/ExtendedProtection/Data/E15_Configured_Cas_ApplicationHost.config diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E15_Configured_Mbx_ApplicationHost.config b/Shared/Tests/ExtendedProtection/Data/E15_Configured_Mbx_ApplicationHost.config similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E15_Configured_Mbx_ApplicationHost.config rename to Shared/Tests/ExtendedProtection/Data/E15_Configured_Mbx_ApplicationHost.config diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E15_NotConfigured_Both_ApplicationHost.config b/Shared/Tests/ExtendedProtection/Data/E15_NotConfigured_Both_ApplicationHost.config similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E15_NotConfigured_Both_ApplicationHost.config rename to Shared/Tests/ExtendedProtection/Data/E15_NotConfigured_Both_ApplicationHost.config diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E15_NotConfigured_Cas_ApplicationHost.config b/Shared/Tests/ExtendedProtection/Data/E15_NotConfigured_Cas_ApplicationHost.config similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E15_NotConfigured_Cas_ApplicationHost.config rename to Shared/Tests/ExtendedProtection/Data/E15_NotConfigured_Cas_ApplicationHost.config diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E15_NotConfigured_Mbx_ApplicationHost.config b/Shared/Tests/ExtendedProtection/Data/E15_NotConfigured_Mbx_ApplicationHost.config similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E15_NotConfigured_Mbx_ApplicationHost.config rename to Shared/Tests/ExtendedProtection/Data/E15_NotConfigured_Mbx_ApplicationHost.config diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E16_Configured_ApplicationHost.config b/Shared/Tests/ExtendedProtection/Data/E16_Configured_ApplicationHost.config similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E16_Configured_ApplicationHost.config rename to Shared/Tests/ExtendedProtection/Data/E16_Configured_ApplicationHost.config diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E16_Configured_IPFilter_ApplicationHost.config b/Shared/Tests/ExtendedProtection/Data/E16_Configured_IPFilter_ApplicationHost.config similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E16_Configured_IPFilter_ApplicationHost.config rename to Shared/Tests/ExtendedProtection/Data/E16_Configured_IPFilter_ApplicationHost.config diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E16_NotConfigured_ApplicationHost.config b/Shared/Tests/ExtendedProtection/Data/E16_NotConfigured_ApplicationHost.config similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E16_NotConfigured_ApplicationHost.config rename to Shared/Tests/ExtendedProtection/Data/E16_NotConfigured_ApplicationHost.config diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E19_Configured_ApplicationHost.config b/Shared/Tests/ExtendedProtection/Data/E19_Configured_ApplicationHost.config similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E19_Configured_ApplicationHost.config rename to Shared/Tests/ExtendedProtection/Data/E19_Configured_ApplicationHost.config diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E19_Configured_IPFilter_ApplicationHost.config b/Shared/Tests/ExtendedProtection/Data/E19_Configured_IPFilter_ApplicationHost.config similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E19_Configured_IPFilter_ApplicationHost.config rename to Shared/Tests/ExtendedProtection/Data/E19_Configured_IPFilter_ApplicationHost.config diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E19_MisConfigured_ApplicationHost.config b/Shared/Tests/ExtendedProtection/Data/E19_MisConfigured_ApplicationHost.config similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E19_MisConfigured_ApplicationHost.config rename to Shared/Tests/ExtendedProtection/Data/E19_MisConfigured_ApplicationHost.config diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E19_NotConfigured_ApplicationHost.config b/Shared/Tests/ExtendedProtection/Data/E19_NotConfigured_ApplicationHost.config similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/E19_NotConfigured_ApplicationHost.config rename to Shared/Tests/ExtendedProtection/Data/E19_NotConfigured_ApplicationHost.config diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/GetAllTlsSettings-AllTlsSettingsDefault.xml b/Shared/Tests/ExtendedProtection/Data/GetAllTlsSettings-AllTlsSettingsDefault.xml similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/GetAllTlsSettings-AllTlsSettingsDefault.xml rename to Shared/Tests/ExtendedProtection/Data/GetAllTlsSettings-AllTlsSettingsDefault.xml diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/GetAllTlsSettings-SchUseStrongCryptoConfigured.xml b/Shared/Tests/ExtendedProtection/Data/GetAllTlsSettings-SchUseStrongCryptoConfigured.xml similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/GetAllTlsSettings-SchUseStrongCryptoConfigured.xml rename to Shared/Tests/ExtendedProtection/Data/GetAllTlsSettings-SchUseStrongCryptoConfigured.xml diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/GetAllTlsSettings-TlsSettingsMisconfigured.xml b/Shared/Tests/ExtendedProtection/Data/GetAllTlsSettings-TlsSettingsMisconfigured.xml similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/GetAllTlsSettings-TlsSettingsMisconfigured.xml rename to Shared/Tests/ExtendedProtection/Data/GetAllTlsSettings-TlsSettingsMisconfigured.xml diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/GetCommand.xml b/Shared/Tests/ExtendedProtection/Data/GetCommand.xml similarity index 100% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Data/GetCommand.xml rename to Shared/Tests/ExtendedProtection/Data/GetCommand.xml diff --git a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Get-ExtendedProtectionConfiguration.Tests.ps1 b/Shared/Tests/ExtendedProtection/Get-ExtendedProtectionConfiguration.Tests.ps1 similarity index 92% rename from Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Get-ExtendedProtectionConfiguration.Tests.ps1 rename to Shared/Tests/ExtendedProtection/Get-ExtendedProtectionConfiguration.Tests.ps1 index 09639cf1c2..3f4ff561e7 100644 --- a/Security/src/ExchangeExtendedProtectionManagement/DataCollection/Tests/Get-ExtendedProtectionConfiguration.Tests.ps1 +++ b/Shared/Tests/ExtendedProtection/Get-ExtendedProtectionConfiguration.Tests.ps1 @@ -7,7 +7,7 @@ param() BeforeAll { $Script:parentPath = (Split-Path -Parent $PSScriptRoot) $Script:Server = $env:COMPUTERNAME - . $Script:parentPath\Get-ExtendedProtectionConfiguration.ps1 + . $Script:parentPath\..\Get-ExtendedProtectionConfiguration.ps1 function Invoke-CatchActions { param() @@ -110,28 +110,28 @@ BeforeAll { } } - $Script:E15_NotConfigured_Both_ApplicationHost = LoadApplicationHostConfig -Path $Script:parentPath\Tests\Data\E15_NotConfigured_Both_ApplicationHost.config - $Script:E15_NotConfigured_Cas_ApplicationHost = LoadApplicationHostConfig -Path $Script:parentPath\Tests\Data\E15_NotConfigured_Cas_ApplicationHost.config - $Script:E15_NotConfigured_Mbx_ApplicationHost = LoadApplicationHostConfig -Path $Script:parentPath\Tests\Data\E15_NotConfigured_Mbx_ApplicationHost.config - $Script:E16_NotConfigured_ApplicationHost = LoadApplicationHostConfig -Path $Script:parentPath\Tests\Data\E16_NotConfigured_ApplicationHost.config - $Script:E19_NotConfigured_ApplicationHost = LoadApplicationHostConfig -Path $Script:parentPath\Tests\Data\E19_NotConfigured_ApplicationHost.config - - $Script:E15_Configured_Both_ApplicationHost = LoadApplicationHostConfig -Path $Script:parentPath\Tests\Data\E15_Configured_Both_ApplicationHost.config - $Script:E15_Configured_Cas_ApplicationHost = LoadApplicationHostConfig -Path $Script:parentPath\Tests\Data\E15_Configured_Cas_ApplicationHost.config - $Script:E15_Configured_Mbx_ApplicationHost = LoadApplicationHostConfig -Path $Script:parentPath\Tests\Data\E15_Configured_Mbx_ApplicationHost.config - $Script:E16_Configured_ApplicationHost = LoadApplicationHostConfig -Path $Script:parentPath\Tests\Data\E16_Configured_ApplicationHost.config - $Script:E16_Configured_IPFilter_ApplicationHost = LoadApplicationHostConfig -Path $Script:parentPath\Tests\Data\E16_Configured_IPFilter_ApplicationHost.config - $Script:E19_Configured_ApplicationHost = LoadApplicationHostConfig -Path $Script:parentPath\Tests\Data\E19_Configured_ApplicationHost.config - $Script:E19_Configured_IPFilter_ApplicationHost = LoadApplicationHostConfig -Path $Script:parentPath\Tests\Data\E19_Configured_IPFilter_ApplicationHost.config - - $Script:E19_MisConfigured_ApplicationHost = LoadApplicationHostConfig -Path $Script:parentPath\Tests\Data\E19_MisConfigured_ApplicationHost.config + $Script:E15_NotConfigured_Both_ApplicationHost = LoadApplicationHostConfig -Path $PSScriptRoot\Data\E15_NotConfigured_Both_ApplicationHost.config + $Script:E15_NotConfigured_Cas_ApplicationHost = LoadApplicationHostConfig -Path $PSScriptRoot\Data\E15_NotConfigured_Cas_ApplicationHost.config + $Script:E15_NotConfigured_Mbx_ApplicationHost = LoadApplicationHostConfig -Path $PSScriptRoot\Data\E15_NotConfigured_Mbx_ApplicationHost.config + $Script:E16_NotConfigured_ApplicationHost = LoadApplicationHostConfig -Path $PSScriptRoot\Data\E16_NotConfigured_ApplicationHost.config + $Script:E19_NotConfigured_ApplicationHost = LoadApplicationHostConfig -Path $PSScriptRoot\Data\E19_NotConfigured_ApplicationHost.config + + $Script:E15_Configured_Both_ApplicationHost = LoadApplicationHostConfig -Path $PSScriptRoot\Data\E15_Configured_Both_ApplicationHost.config + $Script:E15_Configured_Cas_ApplicationHost = LoadApplicationHostConfig -Path $PSScriptRoot\Data\E15_Configured_Cas_ApplicationHost.config + $Script:E15_Configured_Mbx_ApplicationHost = LoadApplicationHostConfig -Path $PSScriptRoot\Data\E15_Configured_Mbx_ApplicationHost.config + $Script:E16_Configured_ApplicationHost = LoadApplicationHostConfig -Path $PSScriptRoot\Data\E16_Configured_ApplicationHost.config + $Script:E16_Configured_IPFilter_ApplicationHost = LoadApplicationHostConfig -Path $PSScriptRoot\Data\E16_Configured_IPFilter_ApplicationHost.config + $Script:E19_Configured_ApplicationHost = LoadApplicationHostConfig -Path $PSScriptRoot\Data\E19_Configured_ApplicationHost.config + $Script:E19_Configured_IPFilter_ApplicationHost = LoadApplicationHostConfig -Path $PSScriptRoot\Data\E19_Configured_IPFilter_ApplicationHost.config + + $Script:E19_MisConfigured_ApplicationHost = LoadApplicationHostConfig -Path $PSScriptRoot\Data\E19_MisConfigured_ApplicationHost.config } Describe "Testing Get-ExtendedProtectionConfiguration.ps1" { Context "No ExSetupVersion Passed To The Function" { BeforeAll { - Mock Get-Command { return Import-Clixml -Path $Script:parentPath\Tests\Data\GetCommand.xml } + Mock Get-Command { return Import-Clixml -Path $PSScriptRoot\Data\GetCommand.xml } $mockParams = @{ ComputerName = $Server