Skip to content

Commit

Permalink
Merge pull request dsccommunity#35 from mhendric/AddRemainingAutoBitl…
Browse files Browse the repository at this point in the history
…ockerTests2

MSFT_xBLAutoBitlocker: Add remaining Unit Tests for xBLAutoBitlocker
  • Loading branch information
mhendric authored Nov 20, 2018
2 parents c84931f + 4132ab3 commit c368660
Show file tree
Hide file tree
Showing 3 changed files with 341 additions and 194 deletions.
16 changes: 11 additions & 5 deletions DSCResources/MSFT_xBLAutoBitlocker/MSFT_xBLAutoBitlocker.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function Set-TargetResource

if ($null -eq $autoBlVols)
{
throw "No Auto Bitlocker volumes were found"
throw 'No Auto Bitlocker volumes were found'
}
else
{
Expand Down Expand Up @@ -320,9 +320,13 @@ function Test-TargetResource

$autoBlVols = GetAutoBitlockerStatus @PSBoundParameters

$allEnabled = $true

if ($null -eq $autoBlVols)
{
return $false
Write-Error -Message 'Failed to retrieve Bitlocker status'

$allEnabled = $false
}
else
{
Expand All @@ -338,12 +342,14 @@ function Test-TargetResource

if ($testResult -eq $false)
{
return $testResult
Write-Verbose -Message "Volume with Key '$key' is not yet enabled for Bitlocker"

$allEnabled = $false
}
}
}

return $true
return $allEnabled
}

function GetAutoBitlockerStatus
Expand Down Expand Up @@ -437,7 +443,7 @@ function GetAutoBitlockerStatus
)

#First get all Bitlocker Volumes of type Data
$allBlvs = Get-BitLockerVolume | Where-Object -FilterScript {$_.VolumeType -eq "Data"}
$allBlvs = Get-BitLockerVolume | Where-Object -FilterScript {$_.VolumeType -eq 'Data'}

#Filter on size if it was specified
if ($PSBoundParameters.ContainsKey("MinDiskCapacityGB"))
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Defaults to false.
originally encrypted and AutoUnlock was not used.
* Add remaining Unit Tests for xBitlockerCommon.
* Add Unit tests for MSFT_xBLTpm
* Add remaining Unit Tests for xBLAutoBitlocker

### 1.2.0.0

Expand Down
Loading

0 comments on commit c368660

Please sign in to comment.