Tests/Integration/ProcessMitigation.integration.tests.ps1

$script:DSCModuleName = 'WindowsDefenderDsc'
$script:DSCResourceName = 'ProcessMitigation'

#region HEADER
# Integration Test Template Version: 1.2.0
[String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or `
    (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) )
{
    & git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))
}

Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath (Join-Path -Path 'DSCResource.Tests' -ChildPath 'TestHelper.psm1')) -Force
$TestEnvironment = Initialize-TestEnvironment `
    -DSCModuleName $script:DSCModuleName `
    -DSCResourceName $script:DSCResourceName `
    -TestType Integration
#endregion

try
{
    $configFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:DSCResourceName).config.ps1"
    . $configFile

    <#
        Because the ProcessMitigation module does not exist in a Server SKU
        we can't run thorough Integration tests in AppVeyor
    #>

    Describe "$($script:DSCResourceName)_Integration" {        
        It 'Should compile the MOF without throwing' {
            {
                & "$($script:DSCResourceName)_Config" -OutputPath $TestDrive
            } | Should Not Throw
        }        
    }
}
finally
{
    Restore-TestEnvironment -TestEnvironment $TestEnvironment
}