This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InModuleScope $script:dscResourceName { | |
Describe 'ResourceName\Get-TargetResource' -Tag 'Get' { | |
BeforeAll { | |
# Mocks for all context blocks. Avoid if possible. | |
} | |
# Context block cannot always be used. | |
Context 'When the system is not in the desired state' { | |
BeforeAll { | |
# Mocks when the system is not in desired state |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param | |
( | |
# Project path | |
[Parameter()] | |
[string] | |
$ProjectPath = (property ProjectPath $BuildRoot), | |
[Parameter()] | |
# Base directory of all output (default to 'output') | |
[string] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.1//EN" "report.dtd"> | |
<report name="Pester (01/29/2020 06:54:44)"> | |
<sessioninfo id="this" start="1580280789517" dump="1580280884237" /> | |
<package name="MSFT_xCluster"> | |
<class name="MSFT_xCluster/MSFT_xCluster" sourcefilename="MSFT_xCluster.psm1"> | |
<method name="<script>" desc="()" line="1"> | |
<counter type="INSTRUCTION" missed="0" covered="3" /> | |
<counter type="LINE" missed="0" covered="3" /> | |
<counter type="METHOD" missed="0" covered="1" /> | |
</method> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuration SetDebugModeForceModuleImport { | |
Node localhost | |
{ | |
LocalConfigurationManager | |
{ | |
DebugMode = 'ForceModuleImport' | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$computersContainerDistinguishedName = (Get-ADDomain).ComputersContainer | |
if ($computersContainerDistinguishedName -match 'DC=.+') | |
{ | |
$domainDistinguishedName = $matches[0] | |
} | |
$ConfigurationData = @{ | |
AllNodes = @( | |
@{ | |
NodeName = 'localhost' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scriptModulesFiles = Get-ChildItem -Path '.' -Recurse -Include '*.psm1' | |
$lines = [PSCustomObject] @() | |
$scriptModulesFiles | % { | |
$parseErrors = $null | |
$definitionAst = [System.Management.Automation.Language.Parser]::ParseFile($_.FullName, [ref] $null, [ref] $parseErrors) | |
if ($parseErrors) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Describe "a" { | |
It "b" { | |
function a () {} | |
$closure = & { | |
$state = @{ | |
Value = 0 | |
} | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Script to add and update labels according how they are defined in the | |
DSC Resource Kit. | |
#> | |
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')] | |
param () | |
<# | |
TODO: Add all your repositories to the array. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---------------------------------# | |
# environment configuration # | |
#---------------------------------# | |
version: 1.0.{build}.0 | |
install: | |
- git clone https://github.com/PowerShell/DscResource.Tests | |
- ps: Write-Verbose -Message "PowerShell version $($PSVersionTable.PSVersion)" -Verbose | |
- ps: Import-Module "$env:APPVEYOR_BUILD_FOLDER\DscResource.Tests\AppVeyor.psm1" | |
- ps: Invoke-AppveyorInstallTask |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-Something | |
{ | |
param | |
( | |
[Parameter()] | |
[System.Boolean] | |
$MockError | |
) | |
} |