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
Mock -CommandName Get-SomeCommand -MockWith { | |
param ( | |
$ErrorVariable | |
) | |
$errorRecord = [System.Management.Automation.ErrorRecord]::new( | |
[System.Exception]::new('Failed!'), | |
'Error', | |
[System.Management.Automation.ErrorCategory]::InvalidOperation, | |
$null | |
) |
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 'Domain Controllers' { | |
Context 'Replication Link Status' { | |
$results = repadmin /showrepl * /csv | ConvertFrom-Csv # Get the results of all replications between all DCs | |
$groups = $results | Group-Object -Property 'Source DSA' # Group the results by the source DC | |
foreach ($sourcedsa in $groups) { | |
# Create a context for each source DC |