зеркало из https://github.com/microsoft/MIMDSC.git
flatten the module, decided to have one module for Sync and Service
This commit is contained in:
Родитель
02e34a5bf4
Коммит
e333f42742
|
@ -13,8 +13,8 @@ function Convert-MimSyncConfigToDsc {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param
|
Param
|
||||||
(
|
(
|
||||||
# Folder with the Sync Service configuration XML files (defaults to $env:ProgramData\MimSyncDsc\Svrexport)
|
# Folder with the Sync Service configuration XML files (defaults to $env:ProgramData\MimDsc\Svrexport)
|
||||||
$Path = "$env:ProgramData\MimSyncDsc\Svrexport"
|
$Path = "$env:ProgramData\MimDsc\Svrexport"
|
||||||
)
|
)
|
||||||
Write-Verbose "Using Path: $Path"
|
Write-Verbose "Using Path: $Path"
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ function Convert-MimSyncConfigToDsc {
|
||||||
#endregion IAF rules
|
#endregion IAF rules
|
||||||
|
|
||||||
#region Join rules
|
#region Join rules
|
||||||
$joinRules = Get-MimSyncJoinRule -ServerConfigurationFolder "$env:ProgramData\MimSyncDsc\Svrexport\"
|
$joinRules = Get-MimSyncJoinRule -ServerConfigurationFolder "$env:ProgramData\MimDsc\Svrexport\"
|
||||||
|
|
||||||
foreach ($joinRule in $joinRules) {
|
foreach ($joinRule in $joinRules) {
|
||||||
$joinCriteriaStrings = @()
|
$joinCriteriaStrings = @()
|
||||||
|
@ -285,7 +285,7 @@ function Convert-MimSyncConfigToDsc {
|
||||||
#endregion Join rules
|
#endregion Join rules
|
||||||
|
|
||||||
#region Projection rules
|
#region Projection rules
|
||||||
$projectionRules = Get-MimSyncProjectionRule -ServerConfigurationFolder "$env:ProgramData\MimSyncDsc\Svrexport\"
|
$projectionRules = Get-MimSyncProjectionRule -ServerConfigurationFolder "$env:ProgramData\MimDsc\Svrexport\"
|
||||||
foreach ($projectionRule in $projectionRules) {
|
foreach ($projectionRule in $projectionRules) {
|
||||||
$dscConfigScriptItems += @'
|
$dscConfigScriptItems += @'
|
||||||
ProjectionRule {1}
|
ProjectionRule {1}
|
|
@ -7,8 +7,8 @@ function Get-MimSyncConfigCache
|
||||||
Get-FimSyncConfigCache
|
Get-FimSyncConfigCache
|
||||||
#>
|
#>
|
||||||
|
|
||||||
# Cache Folder (defaults to $env:ProgramData\MimSyncDsc\BoundAttributesCache)
|
# Cache Folder (defaults to $env:ProgramData\MimDsc\BoundAttributesCache)
|
||||||
$CacheLocation = "$env:ProgramData\MimSyncDsc\Svrexport"
|
$CacheLocation = "$env:ProgramData\MimDsc\Svrexport"
|
||||||
|
|
||||||
Write-Verbose "Using CacheLocation: $CacheLocation"
|
Write-Verbose "Using CacheLocation: $CacheLocation"
|
||||||
|
|
|
@ -16,8 +16,8 @@ function Write-MimSyncConfigCache
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param
|
Param
|
||||||
(
|
(
|
||||||
# Cache Folder (defaults to $env:ProgramData\MimSyncDsc\Svrexport)
|
# Cache Folder (defaults to $env:ProgramData\MimDsc\Svrexport)
|
||||||
$CacheLocation = "$env:ProgramData\MimSyncDsc\Svrexport",
|
$CacheLocation = "$env:ProgramData\MimDsc\Svrexport",
|
||||||
|
|
||||||
# Cache Age (defaults to one day)
|
# Cache Age (defaults to one day)
|
||||||
[TimeSpan]
|
[TimeSpan]
|
|
@ -2,7 +2,7 @@
|
||||||
@{
|
@{
|
||||||
|
|
||||||
# Script module or binary module file associated with this manifest.
|
# Script module or binary module file associated with this manifest.
|
||||||
RootModule = 'MimSyncDsc.psm1'
|
RootModule = 'MimDsc.psm1'
|
||||||
|
|
||||||
# Version number of this module.
|
# Version number of this module.
|
||||||
ModuleVersion = '0.0.1'
|
ModuleVersion = '0.0.1'
|
||||||
|
@ -23,7 +23,7 @@ CompanyName = 'Microsoft Corporation'
|
||||||
Copyright = '(c) Microsoft Corporation. All rights reserved.'
|
Copyright = '(c) Microsoft Corporation. All rights reserved.'
|
||||||
|
|
||||||
# Description of the functionality provided by this module
|
# Description of the functionality provided by this module
|
||||||
Description = 'Desired State Configuration resources for Microsoft Identity Manager Synchronization Service'
|
Description = 'Desired State Configuration resources for Microsoft Identity Manager'
|
||||||
|
|
||||||
# Minimum version of the Windows PowerShell engine required by this module
|
# Minimum version of the Windows PowerShell engine required by this module
|
||||||
PowerShellVersion = '5.0'
|
PowerShellVersion = '5.0'
|
|
@ -1,27 +0,0 @@
|
||||||
### Build script called by Azure Pipelines
|
|
||||||
Write-Host "I'm the build script"
|
|
||||||
|
|
||||||
# Install Pester module if it is not already installed
|
|
||||||
if (-not (Get-Module -Name Pester -ListAvailable))
|
|
||||||
{
|
|
||||||
Write-Host "Installing Pester"
|
|
||||||
Install-Module -Name Pester -Scope CurrentUser -Force -Confirm:$false
|
|
||||||
}
|
|
||||||
|
|
||||||
### Find out what version of Pester we have
|
|
||||||
Get-Module Pester -ListAvailable
|
|
||||||
|
|
||||||
Write-Host 'Copy MimSyncDsc module files to Program Files'
|
|
||||||
Copy-Item .\MimSyncDsc "$env:ProgramFiles\WindowsPowerShell\Modules" -Container -Recurse -Verbose -Force
|
|
||||||
|
|
||||||
Write-Host 'Copy Sync Configuration Files'
|
|
||||||
New-Item -ItemType Directory -Path "$env:ProgramData\MimSyncDsc\Svrexport" -Verbose -Force | Out-Null
|
|
||||||
Copy-Item -Path .\MimSyncDsc\Tests\MimSyncServerConfiguration\* "$env:ProgramData\MimSyncDsc\Svrexport\" -Force -Verbose
|
|
||||||
|
|
||||||
### Run Tests
|
|
||||||
$TestResults = Invoke-Pester -Script .\MimSyncDsc\Tests\*.tests.ps1 -Tag Build -ExcludeTag RunsInLocalConfigurationManager -OutputFile MimSyncDsc.testresults.xml -OutputFormat NUnitXML
|
|
||||||
|
|
||||||
if($TestResults.FailedCount -gt 0)
|
|
||||||
{
|
|
||||||
Write-Error -Message "Test pass failed: `n`t$($TestResults.PassedCount) passed`n`t$($TestResults.FailedCount) failed "
|
|
||||||
}
|
|
|
@ -3,7 +3,7 @@ if (-not (Get-Module xDSCResourceDesigner -ListAvailable))
|
||||||
Install-Module xDSCResourceDesigner -Scope CurrentUser -Force -Confirm:$false
|
Install-Module xDSCResourceDesigner -Scope CurrentUser -Force -Confirm:$false
|
||||||
}
|
}
|
||||||
|
|
||||||
Get-DscResource -Module MimSyncDsc | ForEach-Object {
|
Get-DscResource -Module MimDsc | ForEach-Object {
|
||||||
$dscResource = $PSItem
|
$dscResource = $PSItem
|
||||||
Describe -Tag 'Build' "DscResource Designer Validation for $($dscResource.ResourceType)"{
|
Describe -Tag 'Build' "DscResource Designer Validation for $($dscResource.ResourceType)"{
|
||||||
It 'Test-xDscResource Should Pass'{
|
It 'Test-xDscResource Should Pass'{
|
|
@ -1,4 +1,4 @@
|
||||||
Import-Module -Name MimSyncDsc
|
Import-Module -Name MimDsc
|
||||||
|
|
||||||
Describe Get-MimRegistryKey{
|
Describe Get-MimRegistryKey{
|
||||||
It 'Does Not Throw' {
|
It 'Does Not Throw' {
|
|
@ -1,10 +1,10 @@
|
||||||
Import-Module -Name MimSyncDsc
|
Import-Module -Name MimDsc
|
||||||
|
|
||||||
Describe Get-MimSyncConfigCache{
|
Describe Get-MimSyncConfigCache{
|
||||||
<#
|
<#
|
||||||
It 'Does Throw When Cache is Missing' {
|
It 'Does Throw When Cache is Missing' {
|
||||||
#Arrange
|
#Arrange
|
||||||
Remove-Item -Path "$env:ProgramData\MimSyncDsc\Svrexport" -ErrorAction SilentlyContinue
|
Remove-Item -Path "$env:ProgramData\MimDsc\Svrexport" -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
(Get-MimSyncConfigCache -eq $null) | Should Be True
|
(Get-MimSyncConfigCache -eq $null) | Should Be True
|
||||||
}
|
}
|
||||||
|
@ -12,10 +12,10 @@ Describe Get-MimSyncConfigCache{
|
||||||
|
|
||||||
It 'Does Not Throw When Cache folder is present' {
|
It 'Does Not Throw When Cache folder is present' {
|
||||||
# Arrange
|
# Arrange
|
||||||
mkdir "$env:ProgramData\MimSyncDsc\Svrexport"
|
mkdir "$env:ProgramData\MimDsc\Svrexport"
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
$actualValue = Get-ChildItem "$env:ProgramData\MimSyncDsc\Svrexport"
|
$actualValue = Get-ChildItem "$env:ProgramData\MimDsc\Svrexport"
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
{Get-MimSyncConfigCache } | Should Not Throw
|
{Get-MimSyncConfigCache } | Should Not Throw
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
#Get-MimSyncServerXml -Path (Get-MimSyncConfigCache) -Force
|
#Get-MimSyncServerXml -Path (Get-MimSyncConfigCache) -Force
|
||||||
|
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncExportAttributeFlowRule
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncExportAttributeFlowRule
|
||||||
|
|
||||||
Import-Module -Name $dscResource.Path -Force
|
Import-Module -Name $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncExportAttributeFlowRule
|
||||||
It 'Direct EAF Rule - desired state' {
|
It 'Direct EAF Rule - desired state' {
|
||||||
Configuration TestMimSyncExportAttributeFlowRule
|
Configuration TestMimSyncExportAttributeFlowRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -118,7 +118,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncExportAttributeFlowRule
|
||||||
It 'Scripted EAF Rule - desired state' {
|
It 'Scripted EAF Rule - desired state' {
|
||||||
Configuration TestMimSyncExportAttributeFlowRule
|
Configuration TestMimSyncExportAttributeFlowRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -148,7 +148,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncExportAttributeFlowRule
|
||||||
It 'Scripted EAF Rule - multiple source attributes - desired state' {
|
It 'Scripted EAF Rule - multiple source attributes - desired state' {
|
||||||
Configuration TestMimSyncExportAttributeFlowRule
|
Configuration TestMimSyncExportAttributeFlowRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -178,7 +178,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncExportAttributeFlowRule
|
||||||
It 'Constant EAF Rule - desired state' {
|
It 'Constant EAF Rule - desired state' {
|
||||||
Configuration TestMimSyncExportAttributeFlowRule
|
Configuration TestMimSyncExportAttributeFlowRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncFilterRule
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncFilterRule
|
||||||
|
|
||||||
ipmo $dscResource.Path -Force
|
ipmo $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncFilterRule - using the L
|
||||||
It 'Scripted Filter Rule - desired state' {
|
It 'Scripted Filter Rule - desired state' {
|
||||||
Configuration TestMimSyncFilterRule
|
Configuration TestMimSyncFilterRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -133,7 +133,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncFilterRule - using the L
|
||||||
It 'Scripted Filter Rule - desired state' {
|
It 'Scripted Filter Rule - desired state' {
|
||||||
Configuration TestMimSyncFilterRule
|
Configuration TestMimSyncFilterRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -159,7 +159,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncFilterRule - using the L
|
||||||
It 'Declared Filter Rule - desired state' {
|
It 'Declared Filter Rule - desired state' {
|
||||||
Configuration TestMimSyncFilterRule
|
Configuration TestMimSyncFilterRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncImportAttributeFlowRule
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncImportAttributeFlowRule
|
||||||
|
|
||||||
Import-Module -Name $dscResource.Path -Force
|
Import-Module -Name $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncImportAttributeFlowRule
|
||||||
It 'Direct IAF Rule - desired state' {
|
It 'Direct IAF Rule - desired state' {
|
||||||
Configuration TestMimSyncImportAttributeFlowRule
|
Configuration TestMimSyncImportAttributeFlowRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -143,7 +143,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncImportAttributeFlowRule
|
||||||
It 'Direct IAF Rule - dn-mapping - desired state' {
|
It 'Direct IAF Rule - dn-mapping - desired state' {
|
||||||
Configuration TestMimSyncImportAttributeFlowRule
|
Configuration TestMimSyncImportAttributeFlowRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -172,7 +172,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncImportAttributeFlowRule
|
||||||
It 'DN-Part-Mapping IAF Rule - desired state' {
|
It 'DN-Part-Mapping IAF Rule - desired state' {
|
||||||
Configuration TestMimSyncImportAttributeFlowRule
|
Configuration TestMimSyncImportAttributeFlowRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -201,7 +201,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncImportAttributeFlowRule
|
||||||
It 'Scripted IAF Rule - multiple source attributes - desired state' {
|
It 'Scripted IAF Rule - multiple source attributes - desired state' {
|
||||||
Configuration TestMimSyncImportAttributeFlowRule
|
Configuration TestMimSyncImportAttributeFlowRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -231,7 +231,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncImportAttributeFlowRule
|
||||||
It 'Constant IAF Rule - desired state' {
|
It 'Constant IAF Rule - desired state' {
|
||||||
Configuration TestMimSyncImportAttributeFlowRule
|
Configuration TestMimSyncImportAttributeFlowRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -260,7 +260,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncImportAttributeFlowRule
|
||||||
It 'Issue: IAF Rules with identical key properties' {
|
It 'Issue: IAF Rules with identical key properties' {
|
||||||
Configuration TestMimSyncConfig
|
Configuration TestMimSyncConfig
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncImportAttributePrecedence
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncImportAttributePrecedence
|
||||||
|
|
||||||
Import-Module -Name $dscResource.Path -Force
|
Import-Module -Name $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncRunProfile - using the L
|
||||||
It 'MimSyncRunProfile - desired state' {
|
It 'MimSyncRunProfile - desired state' {
|
||||||
Configuration TestMimSyncImportAttributePrecedenceConfig
|
Configuration TestMimSyncImportAttributePrecedenceConfig
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncJoinRule
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncJoinRule
|
||||||
|
|
||||||
Import-Module -Name $dscResource.Path -Force
|
Import-Module -Name $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncJoinRule - using the Loc
|
||||||
It 'Join Rule - desired state' {
|
It 'Join Rule - desired state' {
|
||||||
Configuration TestMimSyncJoinRule
|
Configuration TestMimSyncJoinRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -213,7 +213,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncJoinRule - using the Loc
|
||||||
It 'Join Rule - incorrect order' {
|
It 'Join Rule - incorrect order' {
|
||||||
Configuration TestMimSyncJoinRule
|
Configuration TestMimSyncJoinRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncMAPartitionData
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncMAPartitionData
|
||||||
|
|
||||||
Import-Module -Name $dscResource.Path -Force
|
Import-Module -Name $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncMAPartitionData - using
|
||||||
It 'MimSyncMAPartitionData - desired state' {
|
It 'MimSyncMAPartitionData - desired state' {
|
||||||
Configuration TestMimSyncMAPartitionDataConfig
|
Configuration TestMimSyncMAPartitionDataConfig
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncMAPrivateConfiguration
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncMAPrivateConfiguration
|
||||||
|
|
||||||
Import-Module -Name $dscResource.Path -Force
|
Import-Module -Name $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncMAPartitionData - using
|
||||||
It 'MimSyncMAPartitionData - desired state' {
|
It 'MimSyncMAPartitionData - desired state' {
|
||||||
Configuration TestMimSyncMAPrivateConfigurationConfig
|
Configuration TestMimSyncMAPrivateConfigurationConfig
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncMVAttributeType
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncMVAttributeType
|
||||||
|
|
||||||
Import-Module -Name $dscResource.Path -Force
|
Import-Module -Name $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncMVAttributeType - using
|
||||||
It 'MimSyncMVAttributeType - desired state' {
|
It 'MimSyncMVAttributeType - desired state' {
|
||||||
Configuration TestMimSyncMVAttributeType
|
Configuration TestMimSyncMVAttributeType
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncMVAttributeType - using
|
||||||
It 'MimSyncMVAttributeType - incorrect indexed state' {
|
It 'MimSyncMVAttributeType - incorrect indexed state' {
|
||||||
Configuration TestMimSyncMVAttributeType
|
Configuration TestMimSyncMVAttributeType
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -100,7 +100,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncMVAttributeType - using
|
||||||
It 'MimSyncMVAttributeType - missing attribute type' {
|
It 'MimSyncMVAttributeType - missing attribute type' {
|
||||||
Configuration TestMimSyncMVAttributeType
|
Configuration TestMimSyncMVAttributeType
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncMVDeletionRule
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncMVDeletionRule
|
||||||
|
|
||||||
Import-Module -Name $dscResource.Path -Force
|
Import-Module -Name $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncMVDeletionRule - using t
|
||||||
It 'MimSyncMVDeletionRule - desired state' {
|
It 'MimSyncMVDeletionRule - desired state' {
|
||||||
Configuration TestMimSyncMVDeletionRule
|
Configuration TestMimSyncMVDeletionRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -59,7 +59,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncMVDeletionRule - using t
|
||||||
It 'MimSyncMVDeletionRule - desired state' {
|
It 'MimSyncMVDeletionRule - desired state' {
|
||||||
Configuration TestMimSyncMVDeletionRule
|
Configuration TestMimSyncMVDeletionRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -82,7 +82,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncMVDeletionRule - using t
|
||||||
#TODO - more tests for other deletion rule types, such as
|
#TODO - more tests for other deletion rule types, such as
|
||||||
Configuration TestMimSyncMVDeletionRule
|
Configuration TestMimSyncMVDeletionRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncMVObjectType
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncMVObjectType
|
||||||
|
|
||||||
Import-Module -Name $dscResource.Path -Force
|
Import-Module -Name $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncMVObjectType - using the
|
||||||
It 'MimSyncMVObjectType - desired state' {
|
It 'MimSyncMVObjectType - desired state' {
|
||||||
Configuration TestMimSyncMVObjectType
|
Configuration TestMimSyncMVObjectType
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -311,7 +311,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncMVObjectType - using the
|
||||||
It 'MimSyncMVObjectType - missing attributes' {
|
It 'MimSyncMVObjectType - missing attributes' {
|
||||||
Configuration TestMimSyncMaData
|
Configuration TestMimSyncMaData
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncMVOptions
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncMVOptions
|
||||||
|
|
||||||
Import-Module -Name $dscResource.Path -Force
|
Import-Module -Name $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncProjectionRule - using t
|
||||||
It 'MVOptions - desired state' {
|
It 'MVOptions - desired state' {
|
||||||
Configuration TestMimSyncMVOptions
|
Configuration TestMimSyncMVOptions
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -61,7 +61,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncProjectionRule - using t
|
||||||
It 'MVOptions - incorrect state' {
|
It 'MVOptions - incorrect state' {
|
||||||
Configuration TestMimSyncMVOptions
|
Configuration TestMimSyncMVOptions
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncMaData
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncMaData
|
||||||
|
|
||||||
Import-Module -Name $dscResource.Path -Force
|
Import-Module -Name $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncMaData - using the Local
|
||||||
It 'MaData - desired state' {
|
It 'MaData - desired state' {
|
||||||
Configuration TestMimSyncMaData
|
Configuration TestMimSyncMaData
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -154,7 +154,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncMaData - using the Local
|
||||||
It 'MaData - incorrect Attribute Inclusion' {
|
It 'MaData - incorrect Attribute Inclusion' {
|
||||||
Configuration TestMimSyncMaData
|
Configuration TestMimSyncMaData
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -204,7 +204,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncMaData - using the Local
|
||||||
It 'MaData - incorrect Assembly Name' {
|
It 'MaData - incorrect Assembly Name' {
|
||||||
Configuration TestMimSyncMaData
|
Configuration TestMimSyncMaData
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncProjectionRule
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncProjectionRule
|
||||||
|
|
||||||
Import-Module -Name $dscResource.Path -Force
|
Import-Module -Name $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncProjectionRule - using t
|
||||||
It 'Projection Rule - desired state' {
|
It 'Projection Rule - desired state' {
|
||||||
Configuration TestMimSyncProjectionRule
|
Configuration TestMimSyncProjectionRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncProjectionRule - using t
|
||||||
It 'Projection Rule - incorrect type' {
|
It 'Projection Rule - incorrect type' {
|
||||||
Configuration TestMimSyncProjectionRule
|
Configuration TestMimSyncProjectionRule
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
$dscResource = Get-DscResource -Module MimSyncDsc -Name MimSyncRunProfile
|
$dscResource = Get-DscResource -Module MimDsc -Name MimSyncRunProfile
|
||||||
|
|
||||||
Import-Module -Name $dscResource.Path -Force
|
Import-Module -Name $dscResource.Path -Force
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ Describe -Tag 'RunsInLocalConfigurationManager' 'MimSyncRunProfile - using the L
|
||||||
It 'MimSyncRunProfile - desired state' {
|
It 'MimSyncRunProfile - desired state' {
|
||||||
Configuration TestMimSyncRunProfile
|
Configuration TestMimSyncRunProfile
|
||||||
{
|
{
|
||||||
Import-DscResource -ModuleName MimSyncDsc
|
Import-DscResource -ModuleName MimDsc
|
||||||
|
|
||||||
Node (hostname)
|
Node (hostname)
|
||||||
{
|
{
|
|
@ -0,0 +1,29 @@
|
||||||
|
### Build script called by Azure Pipelines
|
||||||
|
Write-Host "I'm the build script"
|
||||||
|
|
||||||
|
# Install Pester module if it is not already installed
|
||||||
|
if (-not (Get-Module -Name Pester -ListAvailable))
|
||||||
|
{
|
||||||
|
Write-Host "Installing Pester"
|
||||||
|
Install-Module -Name Pester -Scope CurrentUser -Force -Confirm:$false
|
||||||
|
}
|
||||||
|
|
||||||
|
### Find out what version of Pester we have
|
||||||
|
Get-Module Pester -ListAvailable
|
||||||
|
|
||||||
|
Write-Host 'Copy MimDsc module files to Program Files'
|
||||||
|
Remove-Item "$env:ProgramFiles\WindowsPowerShell\Modules\MimDsc" -Force -Verbose -ErrorAction SilentlyContinue
|
||||||
|
New-Item -ItemType Directory -Path "$env:ProgramFiles\WindowsPowerShell\Modules\MimDsc" -Verbose -Force | Out-Null
|
||||||
|
Copy-Item * "$env:ProgramFiles\WindowsPowerShell\Modules\MimDsc" -Recurse -Verbose -Force -Exclude .git
|
||||||
|
|
||||||
|
Write-Host 'Copy Sync Configuration Files'
|
||||||
|
New-Item -ItemType Directory -Path "$env:ProgramData\MimDsc\Svrexport" -Verbose -Force | Out-Null
|
||||||
|
Copy-Item -Path .\Tests\MimSyncServerConfiguration\* "$env:ProgramData\MimDsc\Svrexport\" -Force -Verbose
|
||||||
|
|
||||||
|
### Run Tests
|
||||||
|
$TestResults = Invoke-Pester -Script .\Tests\*.tests.ps1 -Tag Build -ExcludeTag RunsInLocalConfigurationManager -OutputFile MimSyncDsc.testresults.xml -OutputFormat NUnitXML
|
||||||
|
|
||||||
|
if($TestResults.FailedCount -gt 0)
|
||||||
|
{
|
||||||
|
Write-Error -Message "Test pass failed: `n`t$($TestResults.PassedCount) passed`n`t$($TestResults.FailedCount) failed "
|
||||||
|
}
|
Загрузка…
Ссылка в новой задаче