Created
January 25, 2018 11:54
-
-
Save SQLDBAWithABeard/2dd88c5a46cd9a448b2c24ac671a2a57 to your computer and use it in GitHub Desktop.
Pester test cases
This file contains 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 " This is a test"{ | |
Context "Scoping my tests" { | |
$Drives = (Get-PSDrive -PSProvider FileSystem | Where-Object {$_.Name.Length -eq 1}).Name | |
$TestCases = @() | |
$Drives.ForEach{ | |
$Testcases += @{'DriveLetter' = "$($_):"} | |
} | |
It "Checking if bitlocker is fully encrypted on Drive <DriveLetter>" -TestCases $Testcases { | |
Param($DriveLetter) | |
$a = manage-bde -status $DriveLetter | |
$a -like '*Fully Encrypted*' | Should Be ' Conversion Status: Fully Encrypted' | |
} | |
it "Checking if bitlocker o Drive <DriveLetter> is 100% complete encrypting" -TestCases $Testcases{ | |
Param($DriveLetter) | |
$a = manage-bde -status $DriveLetter | |
$a -like "*100.0%*" | Should be " Percentage Encrypted: 100.0%" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment