diff --git a/CHANGELOG.md b/CHANGELOG.md index 7203f7e9..56af7a77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update repository to use the latest pipeline ([issue #466](https://github.com/dsccommunity/xExchange/issues/466)). - Updated CONTRIBUTING.md file with basic information on how to run integration tests. + - Update repository to use the latest pipeline. + - Update the pipeline to use the build worker Ubuntu 18.04 instead of + Ubuntu 16.04. - xExchOwaVirtualDirectoryInternal - Added additional parameter SetPhotoEnabled - RequiredModules @@ -28,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - xExchange - Fixed casing on folder in repository. - Fixed unit tests so they can run using PowerShell 7. + - Fix style according to style guideline. ## [1.32.0] - 2020-05-13 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1c586db8..f96c87b5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,71 +8,86 @@ If want to know how to run this module's tests you can look at the [Testing Guid ## How to Run Integration Tests -This section describes the necessary information to be able to run the integration tests successfully. +This section describes the necessary information to be able to run the integration +tests successfully. ### Prerequisites - - Read the contributing guidelines document - - Make sure you have an Exchange Server **LAB** environment that is fully functioning with at least the following servers: - - 1 Domain Controller - - 2 Mailbox Servers - - Configured with one Database availability group (DAG) + +- Read the contributing guidelines document +- Make sure you have an Exchange Server **LAB** environment that is fully + functioning with at least the following servers: + - 1 Domain Controller + - 2 Mailbox Servers + - Configured with one Database availability group (DAG) > **Warning:** Please do not run the integration tests in a production environment. ### Domain Controller Server -1. Go to Active Directory Users and Computers - OU Builtin - Double-click Administrators - Members tab and add "Exchange Trusted Subsystem" -2. Create new and computer: Name DAG, on security tab chose "Exchange Trusted Subsystem" and give full control +1. Go to Active Directory Users and Computers - OU Builtin - + Double-click Administrators - Members tab and add "Exchange Trusted Subsystem" +1. Create new and computer: Name DAG, on security tab chose "Exchange + Trusted Subsystem" and give full control ### File Server -We need to make sure that we have a file server so it can act as File Witness for the Database availability group. This could be a Domain Controller in a testing environment, but this is not recommended in a production environment. +We need to make sure that we have a file server so it can act as File Witness +for the Database availability group. This could be a Domain Controller in a +testing environment, but this is not recommended in a production environment. 1. Install Failover Clustering: - ```powershell - Install-WindowsFeature Failover-Clustering - ``` -2. Add "Exchange Trusted Subsystem" account into "Administrator group" -3. Create the file witness directory "C:\Witness" and shared for everyone with full access. -4. Reboot the server + ```powershell + Install-WindowsFeature Failover-Clustering + ``` +1. Add "Exchange Trusted Subsystem" account into "Administrator group" +1. Create the file witness directory "C:\Witness" and shared for everyone with full access. +1. Reboot the server ### Mailbox Servers -We need to make sure that we are able to register the default repository for the PowerShell modules and add needed tools for testing: + +We need to make sure that we are able to register the default repository for +the PowerShell modules and add needed tools for testing: 1. Add default repository: - ```powershell - Register-PSRepository -Default -InstallationPolicy Trusted - ``` -2. Install Chocolatey - ```powershell - Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) - ``` -3. Once chocolatey has been installed, please install git and vscode: - ```powershell - choco install git - choco install vscode - ``` -4. Log in to the Exchange Control Panel (ECP), the Web-based management interface, and create the DAG. In the Windows Server, follow this steps: - * Start Icon - Find the Exchange Administrative Center - logon - Click on Servers - Click on Database Availability Groups tab - " + " : - * Add Database availability group name: DAG (the same on the point 2 for DC) - * Add Witness server: fileserver - * Add path of the Witness directory: C:\Witness - * Go to MailFlow -> RecieveConnector and remove the default FrontEnd, if you don't remove the test fails. - -5. Now, you are ready to adjust the code. Please do the following in one of your mailbox servers: - ```powershell - # Create source folder - mkdir src - # Clone your forked xExchange repository - git clone https://github.com/yourusername/PULLREQUEST - # Go into the correct the cloned repository - cd .\xExchange\ - # Checkout a branch - git checkout [branch_name] + ```powershell + Register-PSRepository -Default -InstallationPolicy Trusted ``` +1. Install Chocolatey + ```powershell + Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) + ``` +1. Once chocolatey has been installed, please install git and vscode: + ```powershell + choco install git + choco install vscode + ``` +1. Log in to the Exchange Control Panel (ECP), the Web-based management interface, + and create the DAG. In the Windows Server, follow this steps: + - Start Icon - Find the Exchange Administrative Center - logon - + Click on Servers - Click on Database Availability Groups tab - " + " : + - Add Database availability group name: DAG (the same on the point 2 for DC) + - Add Witness server: fileserver + - Add path of the Witness directory: C:\Witness + - Go to MailFlow -> RecieveConnector and remove the default FrontEnd, + if you don't remove the test fails. + +1. Now, you are ready to adjust the code. Please do the following in one of + your mailbox servers: + ```powershell + # Create source folder + mkdir src + # Clone your forked xExchange repository + git clone https://github.com/yourusername/PULLREQUEST + # Go into the correct the cloned repository + cd .\xExchange\ + # Checkout a branch + git checkout [branch_name] + ``` + ### Run Integration Tests -Once you have made the necessary changes to the branch please run the following commands +Once you have made the necessary changes to the branch please run the following +commands > **NOTE:** You might need to run this command to allow traffic to https: @@ -90,7 +105,8 @@ Compiles the code with the changes you have made: .\build.ps1 -Tasks build ``` -Run the integration tests located in the `tests/Integration`. Write tests that will ensure that the issue in the code is fixed. See [Testing Guidelines](https://dsccommunity.org/guidelines/testing-guidelines/). +Run the integration tests located in the `tests/Integration`. Write tests that +will ensure that the issue in the code is fixed. See [Testing Guidelines](https://dsccommunity.org/guidelines/testing-guidelines/). ```powershell .\build.ps1 -Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0 diff --git a/RequiredModules.psd1 b/RequiredModules.psd1 index eb9ebde1..13a7cfbf 100644 --- a/RequiredModules.psd1 +++ b/RequiredModules.psd1 @@ -3,7 +3,7 @@ AddToPath = $true Target = 'output\RequiredModules' Parameters = @{ - Repository = 'PSGallery' + Repository = 'PSGallery' } } @@ -21,7 +21,7 @@ xDscResourceDesigner = 'latest' 'DscResource.DocGenerator' = 'latest' - # Prerequisites modules needed for examples or integration tests + # Prerequisites modules needed for examples or integration tests 'xPendingReboot' = '0.4.0' 'xWebAdministration' = '3.1.1' } diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 549974cc..b6af9b90 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -25,7 +25,7 @@ stages: - job: Package_Module displayName: 'Package Module' pool: - vmImage: 'ubuntu 16.04' + vmImage: 'ubuntu 18.04' steps: - task: GitVersion@5 name: gitVersion @@ -120,7 +120,7 @@ stages: displayName: 'Publish Code Coverage' dependsOn: Test_Unit pool: - vmImage: 'ubuntu 16.04' + vmImage: 'ubuntu 18.04' timeoutInMinutes: 0 steps: - pwsh: | @@ -168,7 +168,7 @@ stages: - job: Deploy_Module displayName: 'Deploy Module' pool: - vmImage: 'ubuntu 16.04' + vmImage: 'ubuntu 18.04' steps: - task: DownloadPipelineArtifact@2 displayName: 'Download Pipeline Artifact' diff --git a/source/DSCResources/MSFT_xExchAcceptedDomain/MSFT_xExchAcceptedDomain.psm1 b/source/DSCResources/MSFT_xExchAcceptedDomain/MSFT_xExchAcceptedDomain.psm1 index 8329209b..353fadc3 100644 --- a/source/DSCResources/MSFT_xExchAcceptedDomain/MSFT_xExchAcceptedDomain.psm1 +++ b/source/DSCResources/MSFT_xExchAcceptedDomain/MSFT_xExchAcceptedDomain.psm1 @@ -65,7 +65,9 @@ function Get-TargetResource if ($property -eq 'Default') { $returnValue['MakeDefault'] = $acceptedDomain.$property - } else { + } + else + { $returnValue[$property] = $acceptedDomain.$property } } diff --git a/source/DSCResources/MSFT_xExchActiveSyncVirtualDirectory/MSFT_xExchActiveSyncVirtualDirectory.psm1 b/source/DSCResources/MSFT_xExchActiveSyncVirtualDirectory/MSFT_xExchActiveSyncVirtualDirectory.psm1 index 46861e0d..22f6d33c 100644 --- a/source/DSCResources/MSFT_xExchActiveSyncVirtualDirectory/MSFT_xExchActiveSyncVirtualDirectory.psm1 +++ b/source/DSCResources/MSFT_xExchActiveSyncVirtualDirectory/MSFT_xExchActiveSyncVirtualDirectory.psm1 @@ -383,7 +383,7 @@ function Set-TargetResource -value @{ name = 'Exchange ActiveSync ISAPI Filter' path = "$env:ExchangeInstallPath\FrontEnd\HttpProxy\bin\AirFilter.dll" - } + } } } } diff --git a/source/DSCResources/MSFT_xExchAddressList/MSFT_xExchAddressList.psm1 b/source/DSCResources/MSFT_xExchAddressList/MSFT_xExchAddressList.psm1 index 20fc0da7..19463faf 100644 --- a/source/DSCResources/MSFT_xExchAddressList/MSFT_xExchAddressList.psm1 +++ b/source/DSCResources/MSFT_xExchAddressList/MSFT_xExchAddressList.psm1 @@ -302,7 +302,7 @@ function Set-TargetResource if ($PSBoundParameters.ContainsKey('RecipientFilter') -and ($PSBoundParameters.ContainsKey('IncludedRecipients') -or - $PSBoundParameters.Keys -contains 'Condit')) + $PSBoundParameters.Keys -contains 'Condit')) { throw 'You can''t use customized filters and precanned filters at the same time!' } diff --git a/source/DSCResources/MSFT_xExchAutoMountPoint/MSFT_xExchAutoMountPoint.psm1 b/source/DSCResources/MSFT_xExchAutoMountPoint/MSFT_xExchAutoMountPoint.psm1 index 3f765018..2634cabc 100644 --- a/source/DSCResources/MSFT_xExchAutoMountPoint/MSFT_xExchAutoMountPoint.psm1 +++ b/source/DSCResources/MSFT_xExchAutoMountPoint/MSFT_xExchAutoMountPoint.psm1 @@ -1144,12 +1144,15 @@ function Get-FirstAvailableVolumeNumber return 1 } - $currentFolders = Get-ChildItem -LiteralPath "$($AutoDagVolumesRootFolderPath)" | Where-Object {$_.GetType().Name -eq 'DirectoryInfo'} | Sort-Object + $currentFolders = Get-ChildItem -LiteralPath "$($AutoDagVolumesRootFolderPath)" | + Where-Object { $_.GetType().Name -eq 'DirectoryInfo' } | + Sort-Object for ($i = 1; $i -lt 999; $i++) { $existing = $null - $existing = $currentFolders | Where-Object {$_.Name -eq "$($VolumePrefix)$($i)"} + $existing = $currentFolders | + Where-Object { $_.Name -eq "$($VolumePrefix)$($i)" } if ($null -eq $existing) { @@ -1472,7 +1475,7 @@ function Initialize-ExchangeVolume Start-Sleep -Seconds 15 - Get-Partition -DiskNumber $DiskNumber -PartitionNumber 2| Format-Volume -AllocationUnitSize $UnitSizeBytes -FileSystem REFS -NewFileSystemLabel $Label -SetIntegrityStreams:$false -Confirm:$false + Get-Partition -DiskNumber $DiskNumber -PartitionNumber 2 | Format-Volume -AllocationUnitSize $UnitSizeBytes -FileSystem REFS -NewFileSystemLabel $Label -SetIntegrityStreams:$false -Confirm:$false Add-PartitionAccessPath -DiskNumber $DiskNumber -PartitionNumber 2 -AccessPath $Folder -PassThru | Set-Partition -NoDefaultDriveLetter $true } } diff --git a/source/DSCResources/MSFT_xExchClientAccessServer/MSFT_xExchClientAccessServer.psm1 b/source/DSCResources/MSFT_xExchClientAccessServer/MSFT_xExchClientAccessServer.psm1 index 4a5088d9..8fc18ecd 100644 --- a/source/DSCResources/MSFT_xExchClientAccessServer/MSFT_xExchClientAccessServer.psm1 +++ b/source/DSCResources/MSFT_xExchClientAccessServer/MSFT_xExchClientAccessServer.psm1 @@ -248,7 +248,7 @@ function Set-TargetResource if ($null -ne $AlternateServiceAccountCredential) { $asaParams = @{ - Identity = $Identity + Identity = $Identity AlternateServiceAccountCredential = $AlternateServiceAccountCredential } @@ -266,7 +266,7 @@ function Set-TargetResource if ($RemoveAlternateServiceAccountCredentials) { $asaParams = @{ - Identity = $Identity + Identity = $Identity RemoveAlternateServiceAccountCredentials = $true } @@ -513,7 +513,7 @@ function Get-ClientAccessServerInternal $serverVersion = Get-ExchangeVersionYear -ThrowIfUnknownVersion $true if (($null -ne $AlternateServiceAccountCredential) -or ($RemoveAlternateServiceAccountCredentials)) { - $PSBoundParameters.Add('IncludeAlternateServiceAccountCredentialPassword',$true) + $PSBoundParameters.Add('IncludeAlternateServiceAccountCredentialPassword', $true) } if ($serverVersion -in '2016', '2019') diff --git a/source/DSCResources/MSFT_xExchDatabaseAvailabilityGroupMember/MSFT_xExchDatabaseAvailabilityGroupMember.psm1 b/source/DSCResources/MSFT_xExchDatabaseAvailabilityGroupMember/MSFT_xExchDatabaseAvailabilityGroupMember.psm1 index 711ed81e..e27b7789 100644 --- a/source/DSCResources/MSFT_xExchDatabaseAvailabilityGroupMember/MSFT_xExchDatabaseAvailabilityGroupMember.psm1 +++ b/source/DSCResources/MSFT_xExchDatabaseAvailabilityGroupMember/MSFT_xExchDatabaseAvailabilityGroupMember.psm1 @@ -90,7 +90,7 @@ function Set-TargetResource Write-FunctionEntry -Parameters @{ 'MailboxServer' = $MailboxServer - 'DAGName' = $DAGName + 'DAGName' = $DAGName } -Verbose:$VerbosePreference # Establish remote PowerShell session @@ -152,7 +152,7 @@ function Test-TargetResource Write-FunctionEntry -Parameters @{ 'MailboxServer' = $MailboxServer - 'DAGName' = $DAGName + 'DAGName' = $DAGName } -Verbose:$VerbosePreference # Establish remote PowerShell session diff --git a/source/DSCResources/MSFT_xExchInstall/MSFT_xExchInstall.psm1 b/source/DSCResources/MSFT_xExchInstall/MSFT_xExchInstall.psm1 index cddf6534..333b4532 100644 --- a/source/DSCResources/MSFT_xExchInstall/MSFT_xExchInstall.psm1 +++ b/source/DSCResources/MSFT_xExchInstall/MSFT_xExchInstall.psm1 @@ -5,22 +5,22 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] [System.String] $Path, - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] [System.String] $Arguments, - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] [System.Management.Automation.Credential()] $Credential ) Write-FunctionEntry -Parameters @{ - 'Path' = $Path + 'Path' = $Path 'Arguments' = $Arguments } -Verbose:$VerbosePreference @@ -37,22 +37,22 @@ function Set-TargetResource [CmdletBinding()] param ( - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] [System.String] $Path, - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] [System.String] $Arguments, - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] [System.Management.Automation.Credential()] $Credential ) Write-FunctionEntry -Parameters @{ - 'Path' = $Path + 'Path' = $Path 'Arguments' = $Arguments } -Verbose:$VerbosePreference @@ -111,15 +111,15 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] [System.String] $Path, - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] [System.String] $Arguments, - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] [System.Management.Automation.Credential()] $Credential diff --git a/source/DSCResources/MSFT_xExchJetstress/MSFT_xExchJetstress.psm1 b/source/DSCResources/MSFT_xExchJetstress/MSFT_xExchJetstress.psm1 index 8d2fb854..6c43174f 100644 --- a/source/DSCResources/MSFT_xExchJetstress/MSFT_xExchJetstress.psm1 +++ b/source/DSCResources/MSFT_xExchJetstress/MSFT_xExchJetstress.psm1 @@ -232,7 +232,7 @@ function Test-TargetResource ) Write-FunctionEntry -Parameters @{ - 'JetstressPath' = $JetstressPath + 'JetstressPath' = $JetstressPath 'JetstressParams' = $JetstressParams } -Verbose:$VerbosePreference diff --git a/source/DSCResources/MSFT_xExchMailboxDatabaseCopy/MSFT_xExchMailboxDatabaseCopy.psm1 b/source/DSCResources/MSFT_xExchMailboxDatabaseCopy/MSFT_xExchMailboxDatabaseCopy.psm1 index acd398cb..730bbca0 100644 --- a/source/DSCResources/MSFT_xExchMailboxDatabaseCopy/MSFT_xExchMailboxDatabaseCopy.psm1 +++ b/source/DSCResources/MSFT_xExchMailboxDatabaseCopy/MSFT_xExchMailboxDatabaseCopy.psm1 @@ -812,7 +812,7 @@ function Add-MailboxDatabaseCopyInternal $copyCount++ # Create a copy of the original parameters - $originalPSBoundParameters =@{} + $PSBoundParameters + $originalPSBoundParameters = @{} + $PSBoundParameters Remove-FromPSBoundParametersUsingHashtable -PSBoundParametersIn $PSBoundParameters ` -ParamsToRemove 'Credential', 'AllowServiceRestart', 'AdServerSettingsPreferredServer' diff --git a/source/DSCResources/MSFT_xExchMailboxServer/MSFT_xExchMailboxServer.psm1 b/source/DSCResources/MSFT_xExchMailboxServer/MSFT_xExchMailboxServer.psm1 index 97150d72..46dcfc4c 100644 --- a/source/DSCResources/MSFT_xExchMailboxServer/MSFT_xExchMailboxServer.psm1 +++ b/source/DSCResources/MSFT_xExchMailboxServer/MSFT_xExchMailboxServer.psm1 @@ -526,7 +526,7 @@ function Set-TargetResource if ($serverVersion -eq '2013') { # Check for non-existent parameters in Exchange 2013 - Remove-NotApplicableParamsForVersion -PSBoundParametersIn $PSBoundParameters -ParamName 'WacDiscoveryEndpoint' -ResourceName 'xExchMailboxServer' -ParamExistsInVersion '2016','2019' + Remove-NotApplicableParamsForVersion -PSBoundParametersIn $PSBoundParameters -ParamName 'WacDiscoveryEndpoint' -ResourceName 'xExchMailboxServer' -ParamExistsInVersion '2016', '2019' } elseif ($serverVersion -in '2016', '2019') { @@ -774,7 +774,7 @@ function Test-TargetResource if ($serverVersion -eq '2013') { # Check for non-existent parameters in Exchange 2013 - Remove-NotApplicableParamsForVersion -PSBoundParametersIn $PSBoundParameters -ParamName 'WacDiscoveryEndpoint' -ResourceName 'xExchMailboxServer' -ParamExistsInVersion '2016','2019' + Remove-NotApplicableParamsForVersion -PSBoundParametersIn $PSBoundParameters -ParamName 'WacDiscoveryEndpoint' -ResourceName 'xExchMailboxServer' -ParamExistsInVersion '2016', '2019' } elseif ($serverVersion -in '2016', '2019') { diff --git a/source/DSCResources/MSFT_xExchMaintenanceMode/MSFT_xExchMaintenanceMode.psm1 b/source/DSCResources/MSFT_xExchMaintenanceMode/MSFT_xExchMaintenanceMode.psm1 index 42ca7dbe..590c9294 100644 --- a/source/DSCResources/MSFT_xExchMaintenanceMode/MSFT_xExchMaintenanceMode.psm1 +++ b/source/DSCResources/MSFT_xExchMaintenanceMode/MSFT_xExchMaintenanceMode.psm1 @@ -88,7 +88,8 @@ function Get-TargetResource if ($null -ne $maintenanceModeStatus) { # Determine which components are Active - $activeComponents = $maintenanceModeStatus.ServerComponentState | Where-Object -FilterScript {$_.State -eq "Active"} + $activeComponents = $maintenanceModeStatus.ServerComponentState | + Where-Object -FilterScript { $_.State -eq "Active" } [System.String[]] $activeComponentsList = @() @@ -239,8 +240,8 @@ function Set-TargetResource if ($null -ne $maintenanceModeStatus) { # Set vars relevant to both 'Enabled' code paths - $htStatus = $MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript {$_.Component -eq "HubTransport"} - $haStatus = $MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript {$_.Component -eq "HubTransport"} + $htStatus = $MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript { $_.Component -eq "HubTransport" } + $haStatus = $MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript { $_.Component -eq "HubTransport" } # Put the server into maintenance mode if ($Enabled -eq $true) @@ -283,7 +284,7 @@ function Set-TargetResource # Setup parameters for StartDagServerMaintenance.ps1 $startDagScriptParams = @{ serverName = $env:COMPUTERNAME - Verbose = $true + Verbose = $true } if ((Get-ExchangeVersionYear) -in '2016', '2019') @@ -329,8 +330,8 @@ function Set-TargetResource # Run StopDagServerMaintenance.ps1 if required if ($maintenanceModeStatus.ClusterNode.State -ne "Up" -or ` - $maintenanceModeStatus.MailboxServer.DatabaseCopyAutoActivationPolicy -ne "Unrestricted" -or` - $haStatus.State -ne "Active") + $maintenanceModeStatus.MailboxServer.DatabaseCopyAutoActivationPolicy -ne "Unrestricted" -or ` + $haStatus.State -ne "Active") { Write-Verbose -Message 'Running StopDagServerMaintenance.ps1' @@ -374,7 +375,7 @@ function Set-TargetResource if ((Test-ComponentCheckedByDefault -ComponentName $component) -eq $false) { $status = $null - $status = $MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript {$_.Component -like "$($component)"} + $status = $MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript { $_.Component -like "$($component)" } if ($null -ne $status -and $status.State -ne 'Active') { @@ -521,7 +522,7 @@ function Test-TargetResource $testResults = $false } - if ($null -ne ($MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript {$_.State -ne "Inactive" -and $_.Component -ne "Monitoring" -and $_.Component -ne "RecoveryActionsEnabled"})) + if ($null -ne ($MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript { $_.State -ne "Inactive" -and $_.Component -ne "Monitoring" -and $_.Component -ne "RecoveryActionsEnabled" })) { Write-Verbose -Message 'One or more components have a status other than Inactive' $testResults = $false @@ -570,7 +571,7 @@ function Test-TargetResource # Make sure the server is fully out of maintenance mode else { - $activeComponents = $MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript {$_.State -eq "Active"} + $activeComponents = $MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript { $_.State -eq "Active" } if ($null -eq $activeComponents) { @@ -578,7 +579,7 @@ function Test-TargetResource $testResults = $false } - if ($null -eq ($activeComponents | Where-Object -FilterScript {$_.Component -eq "ServerWideOffline"})) + if ($null -eq ($activeComponents | Where-Object -FilterScript { $_.Component -eq "ServerWideOffline" })) { Write-Verbose -Message 'Component ServerWideOffline is not Active' $testResults = $false @@ -586,14 +587,14 @@ function Test-TargetResource if ($serverVersion -in '2013', '2016') { - if ($null -eq ($activeComponents | Where-Object -FilterScript {$_.Component -eq "UMCallRouter"})) + if ($null -eq ($activeComponents | Where-Object -FilterScript { $_.Component -eq "UMCallRouter" })) { Write-Verbose -Message 'Component UMCallRouter is not Active' $testResults = $false } } - if ($null -eq ($activeComponents | Where-Object -FilterScript {$_.Component -eq "HubTransport"})) + if ($null -eq ($activeComponents | Where-Object -FilterScript { $_.Component -eq "HubTransport" })) { Write-Verbose -Message 'Component HubTransport is not Active' $testResults = $false @@ -611,13 +612,13 @@ function Test-TargetResource $testResults = $false } - if ($null -eq ($activeComponents | Where-Object -FilterScript {$_.Component -eq "Monitoring"})) + if ($null -eq ($activeComponents | Where-Object -FilterScript { $_.Component -eq "Monitoring" })) { Write-Verbose -Message 'Component Monitoring is not Active' $testResults = $false } - if ($null -eq ($activeComponents | Where-Object -FilterScript {$_.Component -eq "RecoveryActionsEnabled"})) + if ($null -eq ($activeComponents | Where-Object -FilterScript { $_.Component -eq "RecoveryActionsEnabled" })) { Write-Verbose -Message 'Component RecoveryActionsEnabled is not Active' $testResults = $false @@ -630,7 +631,7 @@ function Test-TargetResource if ((Test-ComponentCheckedByDefault -ComponentName $component) -eq $false) { $status = $null - $status = $MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript {$_.Component -like "$($component)"} + $status = $MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript { $_.Component -like "$($component)" } if ($null -ne $status -and $Status.State -ne "Active") { @@ -687,11 +688,11 @@ function Get-MaintenanceModeStatus [System.Collections.Hashtable] $returnValue = @{ ServerComponentState = $serverComponentState - ClusterNode = $clusterNode - Queues = $queues - DBCopyStatus = $dbCopyStatus - UMActiveCalls = $umCalls - MailboxServer = $mailboxServer + ClusterNode = $clusterNode + Queues = $queues + DBCopyStatus = $dbCopyStatus + UMActiveCalls = $umCalls + MailboxServer = $mailboxServer } return $returnValue @@ -713,7 +714,7 @@ function Get-QueueMessageCount if ($null -ne $MaintenanceModeStatus.Queues) { - foreach ($queue in $MaintenanceModeStatus.Queues | Where-Object -FilterScript {$_.Identity -notlike "*\Shadow\*"}) + foreach ($queue in $MaintenanceModeStatus.Queues | Where-Object -FilterScript { $_.Identity -notlike "*\Shadow\*" }) { Write-Verbose -Message "Found queue '$($queue.Identity)' with a message count of '$($queue.MessageCount)'." $messageCount += $queue.MessageCount @@ -746,7 +747,7 @@ function Get-ActiveDBCount [UInt32] $activeDBCount = 0 # Get DB's with a status of Mounted, Mounting, Dismounted, or Dismounting - $localDBs = $MaintenanceModeStatus.DBCopyStatus | Where-Object -FilterScript {$_.Status -like "Mount*" -or $_.Status -like "Dismount*"} + $localDBs = $MaintenanceModeStatus.DBCopyStatus | Where-Object -FilterScript { $_.Status -like "Mount*" -or $_.Status -like "Dismount*" } # Ensure that any DB's we found actually have copies foreach ($db in $localDBs) @@ -1074,7 +1075,7 @@ function Update-ComponentState [System.Boolean] $madeChange = $false - $componentState = $MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript {$_.Component -like "$($Component)"} + $componentState = $MaintenanceModeStatus.ServerComponentState | Where-Object -FilterScript { $_.Component -like "$($Component)" } if ($null -ne $componentState) { @@ -1094,7 +1095,7 @@ function Update-ComponentState if ($State -eq "Active" -and $SetInactiveComponentsFromAnyRequesterToActive -eq $true) { $additionalRequesters = $null - $additionalRequesters = $componentState.LocalStates | Where-Object -FilterScript {$_.Requester -notlike "$($Requester)" -and $_.State -notlike "Active"} + $additionalRequesters = $componentState.LocalStates | Where-Object -FilterScript { $_.Requester -notlike "$($Requester)" -and $_.State -notlike "Active" } if ($null -ne $additionalRequesters) { diff --git a/source/DSCResources/MSFT_xExchMaintenanceMode/TransportMaintenance.psm1 b/source/DSCResources/MSFT_xExchMaintenanceMode/TransportMaintenance.psm1 index 12f408a2..8fba3a13 100644 --- a/source/DSCResources/MSFT_xExchMaintenanceMode/TransportMaintenance.psm1 +++ b/source/DSCResources/MSFT_xExchMaintenanceMode/TransportMaintenance.psm1 @@ -619,15 +619,16 @@ function Get-ActiveServer $Servers ) - $activeServers = $Servers | ` - Where-Object { (Get-ServerComponentState -Identity $_ -Component HubTransport).State -eq 'Active' } | ` - ForEach-Object { ` - $xml = [xml] (Get-ExchangeDiagnosticInfo -Process 'EdgeTransport' -server $_ -erroraction SilentlyContinue) - if ($xml -and $xml.Diagnostics.ProcessInfo) - { - Write-Output $_ + $activeServers = $Servers | + Where-Object { (Get-ServerComponentState -Identity $_ -Component HubTransport).State -eq 'Active' } | + ForEach-Object { + $xml = [xml] (Get-ExchangeDiagnosticInfo -Process 'EdgeTransport' -server $_ -ErrorAction SilentlyContinue) + + if ($xml -and $xml.Diagnostics.ProcessInfo) + { + Write-Output $_ + } } - } return $activeServers } @@ -737,8 +738,8 @@ function Register-TransportMaintenanceLog } else { - $newestLog = Get-TransportMaintenanceLogFileList -TransportService $TransportService -LogPath $LogPath | ` - Sort-Object LastWriteTime -Descending | ` + $newestLog = Get-TransportMaintenanceLogFileList -TransportService $TransportService -LogPath $LogPath | + Sort-Object LastWriteTime -Descending | Select-Object -First 1 } @@ -794,8 +795,8 @@ function Remove-TransportMaintenanceLogsOverMaxAge $maxLogAge = [TimeSpan] $TransportService.TransportMaintenanceLogMaxAge [DateTime] $rolloutTime = (Get-Date) - $maxLogAge - Get-TransportMaintenanceLogFileList -TransportService $TransportService -LogPath $LogPath | ` - Where-Object { $_.LastWriteTime -lt $rolloutTime } | ` + Get-TransportMaintenanceLogFileList -TransportService $TransportService -LogPath $LogPath | + Where-Object { $_.LastWriteTime -lt $rolloutTime } | ForEach-Object { Remove-Item -Path $_.FullName } } @@ -1223,15 +1224,16 @@ function Write-EventOfEntry if ($Reason) { - $Reason.GetEnumerator() | ` - Sort-Object Key | ForEach-Object { - if ($ReasonStr) - { - $ReasonStr += '; ' - } + $Reason.GetEnumerator() | + Sort-Object Key | + ForEach-Object { + if ($ReasonStr) + { + $ReasonStr += '; ' + } - $ReasonStr += '{0}={1}' -f $_.Name, $_.Value - } + $ReasonStr += '{0}={1}' -f $_.Name, $_.Value + } } $msg = [System.String]::Format('{0},{1},{2},{3},{4},{5:g},{6},{7},{8}', ` @@ -1796,7 +1798,7 @@ function Wait-EmptyQueuesCompletion ) $filter = "{MessageCount -gt 0 -and DeliveryType -ne 'ShadowRedundancy' -and NextHopDomain -ne 'Poison Message'}" - $queues = get-queue -server $Server -ErrorAction SilentlyContinue -filter $filter | ` + $queues = get-queue -server $Server -ErrorAction SilentlyContinue -filter $filter | Where-Object { $null -eq $QueueTypes -or $QueueTypes -contains $_.DeliveryType } $entries = $queues | ForEach-Object { @@ -1875,22 +1877,22 @@ function Get-DiscardInfo $shadowInfo = [xml] (Get-ExchangeDiagnosticInfo -Server $Server -Process edgetransport -Component ShadowRedundancy -argument $argument) - $discardInfo = $shadowInfo.Diagnostics.Components.ShadowRedundancy.ShadowServerCollection.ShadowServer | ` + $discardInfo = $shadowInfo.Diagnostics.Components.ShadowRedundancy.ShadowServerCollection.ShadowServer | Where-Object { $_.ShadowServerInfo.discardEventsCount -gt 0 } | - ForEach-Object { - $infoProps = ` - @{ - Id = [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($_.Context)) - Count = $_.ShadowServerInfo.discardEventsCount - DiscardIds = @() - } - if ($Detail) - { - $infoProps.DiscardIds = $_.ShadowServerInfo.discardEventMessageId - } + ForEach-Object { + $infoProps = @{ + Id = [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($_.Context)) + Count = $_.ShadowServerInfo.discardEventsCount + DiscardIds = @() + } - New-Object psobject -Property $infoProps - } + if ($Detail) + { + $infoProps.DiscardIds = $_.ShadowServerInfo.discardEventMessageId + } + + New-Object psobject -Property $infoProps + } return $discardInfo } @@ -1956,12 +1958,13 @@ function Wait-EmptyDiscardsCompletion # log the undrainable entries $discardInfo = Get-DiscardInfo -server $Server - $discardInfo | Where-Object { $ActiveServers -notcontains $_.Id.Split('.')[0] } | ForEach-Object { - Write-SkippedEvent -Source $Server -Stage ShadowDiscardDrain -Id $_.Id ` - -Count $_.Count -Reason @{ + $discardInfo | + Where-Object { $ActiveServers -notcontains $_.Id.Split('.')[0] } | + ForEach-Object { + Write-SkippedEvent -Source $Server -Stage ShadowDiscardDrain -Id $_.Id -Count $_.Count -Reason @{ Reason = $Script:ServerInMM } - } + } # wait for discard events to be drained $getDiscardInfo = ` diff --git a/source/DSCResources/MSFT_xExchOabVirtualDirectory/MSFT_xExchOabVirtualDirectory.psm1 b/source/DSCResources/MSFT_xExchOabVirtualDirectory/MSFT_xExchOabVirtualDirectory.psm1 index 8236bf55..025995e2 100644 --- a/source/DSCResources/MSFT_xExchOabVirtualDirectory/MSFT_xExchOabVirtualDirectory.psm1 +++ b/source/DSCResources/MSFT_xExchOabVirtualDirectory/MSFT_xExchOabVirtualDirectory.psm1 @@ -84,7 +84,7 @@ function Get-TargetResource Remove-FromPSBoundParametersUsingHashtable -PSBoundParametersIn $PSBoundParameters -ParamsToKeep 'DomainController' # Get all OAB's which this VDir distributes for, and add their names to an array - $oabs = Get-OfflineAddressBook @PSBoundParameters | Where-Object {$_.VirtualDirectories -like "*$($Identity)*"} + $oabs = Get-OfflineAddressBook @PSBoundParameters | Where-Object { $_.VirtualDirectories -like "*$($Identity)*" } [System.String[]] $oabNames = @() diff --git a/source/DSCResources/MSFT_xExchTransportService/MSFT_xExchTransportService.psm1 b/source/DSCResources/MSFT_xExchTransportService/MSFT_xExchTransportService.psm1 index 04c29268..ea55f72b 100644 --- a/source/DSCResources/MSFT_xExchTransportService/MSFT_xExchTransportService.psm1 +++ b/source/DSCResources/MSFT_xExchTransportService/MSFT_xExchTransportService.psm1 @@ -186,12 +186,12 @@ function Get-TargetResource $MaxConnectionRatePerMinute, [Parameter()] - [ValidateRange(1,2147483647)] + [ValidateRange(1, 2147483647)] [System.String] $MaxOutboundConnections, [Parameter()] - [ValidateRange(1,2147483647)] + [ValidateRange(1, 2147483647)] [System.String] $MaxPerDomainOutboundConnections, @@ -236,12 +236,12 @@ function Get-TargetResource $PickupDirectoryMaxHeaderSize, [Parameter()] - [ValidateRange(1,20000)] + [ValidateRange(1, 20000)] [System.Int32] $PickupDirectoryMaxMessagesPerMinute, [Parameter()] - [ValidateRange(1,10000)] + [ValidateRange(1, 10000)] [System.Int32] $PickupDirectoryMaxRecipientsPerMessage, @@ -266,7 +266,7 @@ function Get-TargetResource $PoisonMessageDetectionEnabled, [Parameter()] - [ValidateRange(1,10)] + [ValidateRange(1, 10)] [System.Int32] $PoisonThreshold, @@ -363,7 +363,7 @@ function Get-TargetResource $ServerStatisticsLogPath, [Parameter()] - [ValidateRange(1,15)] + [ValidateRange(1, 15)] [System.Int32] $TransientFailureRetryCount, @@ -390,94 +390,94 @@ function Get-TargetResource if ($null -ne $TransportService) { $returnValue = @{ - Identity = [System.String] $Identity - ActiveUserStatisticsLogMaxAge = [System.String] $TransportService.ActiveUserStatisticsLogMaxAge - ActiveUserStatisticsLogMaxDirectorySize = [System.String] $TransportService.ActiveUserStatisticsLogMaxDirectorySize - ActiveUserStatisticsLogMaxFileSize = [System.String] $TransportService.ActiveUserStatisticsLogMaxFileSize - ActiveUserStatisticsLogPath = [System.String] $TransportService.ActiveUserStatisticsLogPath - AgentLogEnabled = [System.Boolean] $TransportService.AgentLogEnabled - AgentLogMaxAge = [System.String] $TransportService.AgentLogMaxAge - AgentLogMaxDirectorySize = [System.String] $TransportService.AgentLogMaxDirectorySize - AgentLogMaxFileSize = [System.String] $TransportService.AgentLogMaxFileSize - AgentLogPath = [System.String] $TransportService.AgentLogPath - AntispamAgentsEnabled = [System.Boolean] $TransportService.AntispamAgentsEnabled - ConnectivityLogEnabled = [System.Boolean] $TransportService.ConnectivityLogEnabled - ConnectivityLogMaxAge = [System.String] $TransportService.ConnectivityLogMaxAge - ConnectivityLogMaxDirectorySize = [System.String] $TransportService.ConnectivityLogMaxDirectorySize - ConnectivityLogMaxFileSize = [System.String] $TransportService.ConnectivityLogMaxFileSize - ConnectivityLogPath = [System.String] $TransportService.ConnectivityLogPath - ContentConversionTracingEnabled = [System.Boolean] $TransportService.ContentConversionTracingEnabled - DelayNotificationTimeout = [System.String] $TransportService.DelayNotificationTimeout - DnsLogEnabled = [System.Boolean] $TransportService.DnsLogEnabled - DnsLogMaxAge = [System.String] $TransportService.DnsLogMaxAge - DnsLogMaxDirectorySize = [System.String] $TransportService.DnsLogMaxDirectorySize - DnsLogMaxFileSize = [System.String] $TransportService.DnsLogMaxFileSize - DnsLogPath = [System.String] $TransportService.DnsLogPath - ExternalDNSAdapterEnabled = [System.Boolean] $TransportService.ExternalDNSAdapterEnabled - ExternalDNSAdapterGuid = [System.String] $TransportService.ExternalDNSAdapterGuid - ExternalDNSProtocolOption = [System.String] $TransportService.ExternalDNSProtocolOption - ExternalDNSServers = [System.String[]] $TransportService.ExternalDNSServers - ExternalIPAddress = [System.String] $TransportService.ExternalIPAddress - InternalDNSAdapterEnabled = [System.Boolean] $TransportService.InternalDNSAdapterEnabled - InternalDNSAdapterGuid = [System.String] $TransportService.InternalDNSAdapterGuid - InternalDNSProtocolOption = [System.String] $TransportService.InternalDNSProtocolOption - InternalDNSServers = [System.String[]] $TransportService.InternalDNSServers - IntraOrgConnectorProtocolLoggingLevel = [System.String] $TransportService.IntraOrgConnectorProtocolLoggingLevel - IntraOrgConnectorSmtpMaxMessagesPerConnection = [System.Int32] $TransportService.IntraOrgConnectorSmtpMaxMessagesPerConnection - IrmLogEnabled = [System.Boolean] $TransportService.IrmLogEnabled - IrmLogMaxAge = [System.String] $TransportService.IrmLogMaxAge - IrmLogMaxDirectorySize = [System.String] $TransportService.IrmLogMaxDirectorySize - IrmLogMaxFileSize = [System.String] $TransportService.IrmLogMaxFileSize - IrmLogPath = [System.String] $TransportService.IrmLogPath - MaxConcurrentMailboxDeliveries = [System.Int32] $TransportService.MaxConcurrentMailboxDeliveries - MaxConcurrentMailboxSubmissions = [System.Int32] $TransportService.MaxConcurrentMailboxSubmissions - MaxConnectionRatePerMinute = [System.Int32] $TransportService.MaxConnectionRatePerMinute - MaxOutboundConnections = [System.String] $TransportService.MaxOutboundConnections - MaxPerDomainOutboundConnections = [System.String] $TransportService.MaxPerDomainOutboundConnections - MessageExpirationTimeout = [System.String] $TransportService.MessageExpirationTimeout - MessageRetryInterval = [System.String] $TransportService.MessageRetryInterval - MessageTrackingLogEnabled = [System.Boolean] $TransportService.MessageTrackingLogEnabled - MessageTrackingLogMaxAge = [System.String] $TransportService.MessageTrackingLogMaxAge - MessageTrackingLogMaxDirectorySize = [System.String] $TransportService.MessageTrackingLogMaxDirectorySize - MessageTrackingLogMaxFileSize = [System.String] $TransportService.MessageTrackingLogMaxFileSize - MessageTrackingLogPath = [System.String] $TransportService.MessageTrackingLogPath - MessageTrackingLogSubjectLoggingEnabled = [System.Boolean] $TransportService.MessageTrackingLogSubjectLoggingEnabled - OutboundConnectionFailureRetryInterval = [System.String] $TransportService.OutboundConnectionFailureRetryInterval - PickupDirectoryMaxHeaderSize = [System.String] $TransportService.PickupDirectoryMaxHeaderSize - PickupDirectoryMaxMessagesPerMinute = [System.Int32] $TransportService.PickupDirectoryMaxMessagesPerMinute - PickupDirectoryMaxRecipientsPerMessage = [System.Int32] $TransportService.PickupDirectoryMaxRecipientsPerMessage - PickupDirectoryPath = [System.String] $TransportService.PickupDirectoryPath - PipelineTracingEnabled = [System.Boolean] $TransportService.PipelineTracingEnabled - PipelineTracingPath = [System.String] $TransportService.PipelineTracingPath - PipelineTracingSenderAddress = [System.String] $TransportService.PipelineTracingSenderAddress - PoisonMessageDetectionEnabled = [System.Boolean] $TransportService.PoisonMessageDetectionEnabled - PoisonThreshold = [System.Int32] $TransportService.PoisonThreshold - QueueLogMaxAge = [System.String] $TransportService.QueueLogMaxAge - QueueLogMaxDirectorySize = [System.String] $TransportService.QueueLogMaxDirectorySize - QueueLogMaxFileSize = [System.String] $TransportService.QueueLogMaxFileSize - QueueLogPath = [System.String] $TransportService.QueueLogPath - QueueMaxIdleTime = [System.String] $TransportService.QueueMaxIdleTime - ReceiveProtocolLogMaxAge = [System.String] $TransportService.ReceiveProtocolLogMaxAge - ReceiveProtocolLogMaxDirectorySize = [System.String] $TransportService.ReceiveProtocolLogMaxDirectorySize - ReceiveProtocolLogMaxFileSize = [System.String] $TransportService.ReceiveProtocolLogMaxFileSize - ReceiveProtocolLogPath = [System.String] $TransportService.ReceiveProtocolLogPath - RecipientValidationCacheEnabled = [System.Boolean] $TransportService.RecipientValidationCacheEnabled - ReplayDirectoryPath = [System.String] $TransportService.ReplayDirectoryPath - RootDropDirectoryPath = [System.String] $TransportService.RootDropDirectoryPath - RoutingTableLogMaxAge = [System.String] $TransportService.RoutingTableLogMaxAge - RoutingTableLogMaxDirectorySize = [System.String] $TransportService.RoutingTableLogMaxDirectorySize - RoutingTableLogPath = [System.String] $TransportService.RoutingTableLogPath - SendProtocolLogMaxAge = [System.String] $TransportService.SendProtocolLogMaxAge - SendProtocolLogMaxDirectorySize = [System.String] $TransportService.SendProtocolLogMaxDirectorySize - SendProtocolLogMaxFileSize = [System.String] $TransportService.SendProtocolLogMaxFileSize - SendProtocolLogPath = [System.String] $TransportService.SendProtocolLogPath - ServerStatisticsLogMaxAge = [System.String] $TransportService.ServerStatisticsLogMaxAge - ServerStatisticsLogMaxDirectorySize = [System.String] $TransportService.ServerStatisticsLogMaxDirectorySize - ServerStatisticsLogMaxFileSize = [System.String] $TransportService.ServerStatisticsLogMaxFileSize - ServerStatisticsLogPath = [System.String] $TransportService.ServerStatisticsLogPath - TransientFailureRetryCount = [System.Int32] $TransportService.TransientFailureRetryCount - TransientFailureRetryInterval = [System.String] $TransportService.TransientFailureRetryInterval.ToString() - UseDowngradedExchangeServerAuth = [System.Boolean] $TransportService.UseDowngradedExchangeServerAuth + Identity = [System.String] $Identity + ActiveUserStatisticsLogMaxAge = [System.String] $TransportService.ActiveUserStatisticsLogMaxAge + ActiveUserStatisticsLogMaxDirectorySize = [System.String] $TransportService.ActiveUserStatisticsLogMaxDirectorySize + ActiveUserStatisticsLogMaxFileSize = [System.String] $TransportService.ActiveUserStatisticsLogMaxFileSize + ActiveUserStatisticsLogPath = [System.String] $TransportService.ActiveUserStatisticsLogPath + AgentLogEnabled = [System.Boolean] $TransportService.AgentLogEnabled + AgentLogMaxAge = [System.String] $TransportService.AgentLogMaxAge + AgentLogMaxDirectorySize = [System.String] $TransportService.AgentLogMaxDirectorySize + AgentLogMaxFileSize = [System.String] $TransportService.AgentLogMaxFileSize + AgentLogPath = [System.String] $TransportService.AgentLogPath + AntispamAgentsEnabled = [System.Boolean] $TransportService.AntispamAgentsEnabled + ConnectivityLogEnabled = [System.Boolean] $TransportService.ConnectivityLogEnabled + ConnectivityLogMaxAge = [System.String] $TransportService.ConnectivityLogMaxAge + ConnectivityLogMaxDirectorySize = [System.String] $TransportService.ConnectivityLogMaxDirectorySize + ConnectivityLogMaxFileSize = [System.String] $TransportService.ConnectivityLogMaxFileSize + ConnectivityLogPath = [System.String] $TransportService.ConnectivityLogPath + ContentConversionTracingEnabled = [System.Boolean] $TransportService.ContentConversionTracingEnabled + DelayNotificationTimeout = [System.String] $TransportService.DelayNotificationTimeout + DnsLogEnabled = [System.Boolean] $TransportService.DnsLogEnabled + DnsLogMaxAge = [System.String] $TransportService.DnsLogMaxAge + DnsLogMaxDirectorySize = [System.String] $TransportService.DnsLogMaxDirectorySize + DnsLogMaxFileSize = [System.String] $TransportService.DnsLogMaxFileSize + DnsLogPath = [System.String] $TransportService.DnsLogPath + ExternalDNSAdapterEnabled = [System.Boolean] $TransportService.ExternalDNSAdapterEnabled + ExternalDNSAdapterGuid = [System.String] $TransportService.ExternalDNSAdapterGuid + ExternalDNSProtocolOption = [System.String] $TransportService.ExternalDNSProtocolOption + ExternalDNSServers = [System.String[]] $TransportService.ExternalDNSServers + ExternalIPAddress = [System.String] $TransportService.ExternalIPAddress + InternalDNSAdapterEnabled = [System.Boolean] $TransportService.InternalDNSAdapterEnabled + InternalDNSAdapterGuid = [System.String] $TransportService.InternalDNSAdapterGuid + InternalDNSProtocolOption = [System.String] $TransportService.InternalDNSProtocolOption + InternalDNSServers = [System.String[]] $TransportService.InternalDNSServers + IntraOrgConnectorProtocolLoggingLevel = [System.String] $TransportService.IntraOrgConnectorProtocolLoggingLevel + IntraOrgConnectorSmtpMaxMessagesPerConnection = [System.Int32] $TransportService.IntraOrgConnectorSmtpMaxMessagesPerConnection + IrmLogEnabled = [System.Boolean] $TransportService.IrmLogEnabled + IrmLogMaxAge = [System.String] $TransportService.IrmLogMaxAge + IrmLogMaxDirectorySize = [System.String] $TransportService.IrmLogMaxDirectorySize + IrmLogMaxFileSize = [System.String] $TransportService.IrmLogMaxFileSize + IrmLogPath = [System.String] $TransportService.IrmLogPath + MaxConcurrentMailboxDeliveries = [System.Int32] $TransportService.MaxConcurrentMailboxDeliveries + MaxConcurrentMailboxSubmissions = [System.Int32] $TransportService.MaxConcurrentMailboxSubmissions + MaxConnectionRatePerMinute = [System.Int32] $TransportService.MaxConnectionRatePerMinute + MaxOutboundConnections = [System.String] $TransportService.MaxOutboundConnections + MaxPerDomainOutboundConnections = [System.String] $TransportService.MaxPerDomainOutboundConnections + MessageExpirationTimeout = [System.String] $TransportService.MessageExpirationTimeout + MessageRetryInterval = [System.String] $TransportService.MessageRetryInterval + MessageTrackingLogEnabled = [System.Boolean] $TransportService.MessageTrackingLogEnabled + MessageTrackingLogMaxAge = [System.String] $TransportService.MessageTrackingLogMaxAge + MessageTrackingLogMaxDirectorySize = [System.String] $TransportService.MessageTrackingLogMaxDirectorySize + MessageTrackingLogMaxFileSize = [System.String] $TransportService.MessageTrackingLogMaxFileSize + MessageTrackingLogPath = [System.String] $TransportService.MessageTrackingLogPath + MessageTrackingLogSubjectLoggingEnabled = [System.Boolean] $TransportService.MessageTrackingLogSubjectLoggingEnabled + OutboundConnectionFailureRetryInterval = [System.String] $TransportService.OutboundConnectionFailureRetryInterval + PickupDirectoryMaxHeaderSize = [System.String] $TransportService.PickupDirectoryMaxHeaderSize + PickupDirectoryMaxMessagesPerMinute = [System.Int32] $TransportService.PickupDirectoryMaxMessagesPerMinute + PickupDirectoryMaxRecipientsPerMessage = [System.Int32] $TransportService.PickupDirectoryMaxRecipientsPerMessage + PickupDirectoryPath = [System.String] $TransportService.PickupDirectoryPath + PipelineTracingEnabled = [System.Boolean] $TransportService.PipelineTracingEnabled + PipelineTracingPath = [System.String] $TransportService.PipelineTracingPath + PipelineTracingSenderAddress = [System.String] $TransportService.PipelineTracingSenderAddress + PoisonMessageDetectionEnabled = [System.Boolean] $TransportService.PoisonMessageDetectionEnabled + PoisonThreshold = [System.Int32] $TransportService.PoisonThreshold + QueueLogMaxAge = [System.String] $TransportService.QueueLogMaxAge + QueueLogMaxDirectorySize = [System.String] $TransportService.QueueLogMaxDirectorySize + QueueLogMaxFileSize = [System.String] $TransportService.QueueLogMaxFileSize + QueueLogPath = [System.String] $TransportService.QueueLogPath + QueueMaxIdleTime = [System.String] $TransportService.QueueMaxIdleTime + ReceiveProtocolLogMaxAge = [System.String] $TransportService.ReceiveProtocolLogMaxAge + ReceiveProtocolLogMaxDirectorySize = [System.String] $TransportService.ReceiveProtocolLogMaxDirectorySize + ReceiveProtocolLogMaxFileSize = [System.String] $TransportService.ReceiveProtocolLogMaxFileSize + ReceiveProtocolLogPath = [System.String] $TransportService.ReceiveProtocolLogPath + RecipientValidationCacheEnabled = [System.Boolean] $TransportService.RecipientValidationCacheEnabled + ReplayDirectoryPath = [System.String] $TransportService.ReplayDirectoryPath + RootDropDirectoryPath = [System.String] $TransportService.RootDropDirectoryPath + RoutingTableLogMaxAge = [System.String] $TransportService.RoutingTableLogMaxAge + RoutingTableLogMaxDirectorySize = [System.String] $TransportService.RoutingTableLogMaxDirectorySize + RoutingTableLogPath = [System.String] $TransportService.RoutingTableLogPath + SendProtocolLogMaxAge = [System.String] $TransportService.SendProtocolLogMaxAge + SendProtocolLogMaxDirectorySize = [System.String] $TransportService.SendProtocolLogMaxDirectorySize + SendProtocolLogMaxFileSize = [System.String] $TransportService.SendProtocolLogMaxFileSize + SendProtocolLogPath = [System.String] $TransportService.SendProtocolLogPath + ServerStatisticsLogMaxAge = [System.String] $TransportService.ServerStatisticsLogMaxAge + ServerStatisticsLogMaxDirectorySize = [System.String] $TransportService.ServerStatisticsLogMaxDirectorySize + ServerStatisticsLogMaxFileSize = [System.String] $TransportService.ServerStatisticsLogMaxFileSize + ServerStatisticsLogPath = [System.String] $TransportService.ServerStatisticsLogPath + TransientFailureRetryCount = [System.Int32] $TransportService.TransientFailureRetryCount + TransientFailureRetryInterval = [System.String] $TransportService.TransientFailureRetryInterval.ToString() + UseDowngradedExchangeServerAuth = [System.Boolean] $TransportService.UseDowngradedExchangeServerAuth } } $returnValue @@ -669,12 +669,12 @@ function Set-TargetResource $MaxConnectionRatePerMinute, [Parameter()] - [ValidateRange(1,2147483647)] + [ValidateRange(1, 2147483647)] [System.String] $MaxOutboundConnections, [Parameter()] - [ValidateRange(1,2147483647)] + [ValidateRange(1, 2147483647)] [System.String] $MaxPerDomainOutboundConnections, @@ -719,12 +719,12 @@ function Set-TargetResource $PickupDirectoryMaxHeaderSize, [Parameter()] - [ValidateRange(1,20000)] + [ValidateRange(1, 20000)] [System.Int32] $PickupDirectoryMaxMessagesPerMinute, [Parameter()] - [ValidateRange(1,10000)] + [ValidateRange(1, 10000)] [System.Int32] $PickupDirectoryMaxRecipientsPerMessage, @@ -749,7 +749,7 @@ function Set-TargetResource $PoisonMessageDetectionEnabled, [Parameter()] - [ValidateRange(1,10)] + [ValidateRange(1, 10)] [System.Int32] $PoisonThreshold, @@ -846,7 +846,7 @@ function Set-TargetResource $ServerStatisticsLogPath, [Parameter()] - [ValidateRange(1,15)] + [ValidateRange(1, 15)] [System.Int32] $TransientFailureRetryCount, @@ -1114,12 +1114,12 @@ function Test-TargetResource $MaxConnectionRatePerMinute, [Parameter()] - [ValidateRange(1,2147483647)] + [ValidateRange(1, 2147483647)] [System.String] $MaxOutboundConnections, [Parameter()] - [ValidateRange(1,2147483647)] + [ValidateRange(1, 2147483647)] [System.String] $MaxPerDomainOutboundConnections, @@ -1164,12 +1164,12 @@ function Test-TargetResource $PickupDirectoryMaxHeaderSize, [Parameter()] - [ValidateRange(1,20000)] + [ValidateRange(1, 20000)] [System.Int32] $PickupDirectoryMaxMessagesPerMinute, [Parameter()] - [ValidateRange(1,10000)] + [ValidateRange(1, 10000)] [System.Int32] $PickupDirectoryMaxRecipientsPerMessage, @@ -1194,7 +1194,7 @@ function Test-TargetResource $PoisonMessageDetectionEnabled, [Parameter()] - [ValidateRange(1,10)] + [ValidateRange(1, 10)] [System.Int32] $PoisonThreshold, @@ -1291,7 +1291,7 @@ function Test-TargetResource $ServerStatisticsLogPath, [Parameter()] - [ValidateRange(1,15)] + [ValidateRange(1, 15)] [System.Int32] $TransientFailureRetryCount, diff --git a/source/DSCResources/MSFT_xExchUMCallRouterSettings/MSFT_xExchUMCallRouterSettings.psm1 b/source/DSCResources/MSFT_xExchUMCallRouterSettings/MSFT_xExchUMCallRouterSettings.psm1 index 847815dc..edebea3b 100644 --- a/source/DSCResources/MSFT_xExchUMCallRouterSettings/MSFT_xExchUMCallRouterSettings.psm1 +++ b/source/DSCResources/MSFT_xExchUMCallRouterSettings/MSFT_xExchUMCallRouterSettings.psm1 @@ -19,7 +19,7 @@ function Get-TargetResource $DialPlans, [Parameter()] - [ValidateSet('IPv4Only','IPv6Only','Any')] + [ValidateSet('IPv4Only', 'IPv6Only', 'Any')] [System.String] $IPAddressFamily, @@ -99,7 +99,7 @@ function Set-TargetResource $DialPlans, [Parameter()] - [ValidateSet('IPv4Only','IPv6Only','Any')] + [ValidateSet('IPv4Only', 'IPv6Only', 'Any')] [System.String] $IPAddressFamily, @@ -164,7 +164,7 @@ function Test-TargetResource $DialPlans, [Parameter()] - [ValidateSet('IPv4Only','IPv6Only','Any')] + [ValidateSet('IPv4Only', 'IPv6Only', 'Any')] [System.String] $IPAddressFamily, diff --git a/source/xExchange.psd1 b/source/xExchange.psd1 index 208108b8..edc74ef4 100644 --- a/source/xExchange.psd1 +++ b/source/xExchange.psd1 @@ -93,7 +93,7 @@ PrivateData = @{ PSData = @{ - Prerelease = '' + Prerelease = '' IconUri = 'https://dsccommunity.org/images/DSC_Logo_300p.png'