Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustindortch/4c084295fe361a1a516c4868f020630e to your computer and use it in GitHub Desktop.
Save dustindortch/4c084295fe361a1a516c4868f020630e to your computer and use it in GitHub Desktop.
# Pester testing
## Prep work
## Depends - Pester, AzureADPreview, and xAzureAD.DirectorySettings modules
## Get original values - Get-AzureADDirectorySetting -Name Group.Unified | Export-Csv <Path> -NoTypeInformation
$ExpectedSettings = Import-Csv <Path>
Describe 'Azure AD Group Creation Settings' {
$ActualSettings = Get-AzureADDirectorySetting -Name Group.Unified
ForEach ($Setting in $ExpectedSettings) {
It "has the expected setting $($Setting.Name)" {
($ActualSettings | Where-Object {$_.Name -eq $Setting.Name}).Value | Should Be ($ExpectedSettings | Where-Object {$_.Name -eq $Setting.name}).Value
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment