Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SQLDBAWithABeard/2dd88c5a46cd9a448b2c24ac671a2a57 to your computer and use it in GitHub Desktop.
Save SQLDBAWithABeard/2dd88c5a46cd9a448b2c24ac671a2a57 to your computer and use it in GitHub Desktop.
Pester test cases
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