Skip to content

Commit

Permalink
Fix for issue dsccommunity#10
Browse files Browse the repository at this point in the history
AutoBitLocker should handle volumes with drive letter assigned now
  • Loading branch information
Martin Vokurek committed May 28, 2018
1 parent 9b00d76 commit a4399b9
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions DSCResources/MSFT_xBLAutoBitlocker/MSFT_xBLAutoBitlocker.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ function Get-TargetResource
$UsedSpaceOnly
)

#Load helper module Import-Module "$((Get-Item -LiteralPath "$($PSScriptRoot)").Parent.Parent.FullName)\Misc\xBitlockerCommon.psm1" -Verbose:0
#Load helper module
Import-Module "$((Get-Item -LiteralPath "$($PSScriptRoot)").Parent.Parent.FullName)\Misc\xBitlockerCommon.psm1" -Verbose:0

CheckForPreReqs

Expand Down Expand Up @@ -152,7 +153,8 @@ function Set-TargetResource
$UsedSpaceOnly
)

#Load helper module Import-Module "$((Get-Item -LiteralPath "$($PSScriptRoot)").Parent.Parent.FullName)\Misc\xBitlockerCommon.psm1" -Verbose:0
#Load helper module
Import-Module "$((Get-Item -LiteralPath "$($PSScriptRoot)").Parent.Parent.FullName)\Misc\xBitlockerCommon.psm1" -Verbose:0

CheckForPreReqs

Expand Down Expand Up @@ -254,7 +256,8 @@ function Test-TargetResource
$UsedSpaceOnly
)

#Load helper module Import-Module "$((Get-Item -LiteralPath "$($PSScriptRoot)").Parent.Parent.FullName)\Misc\xBitlockerCommon.psm1" -Verbose:0
#Load helper module
Import-Module "$((Get-Item -LiteralPath "$($PSScriptRoot)").Parent.Parent.FullName)\Misc\xBitlockerCommon.psm1" -Verbose:0

CheckForPreReqs

Expand Down Expand Up @@ -375,7 +378,11 @@ function GetAutoBitlockerStatus
foreach ($blv in $allBlvs)
{
$vol = $null
$vol = Get-Volume -Path $blv.MountPoint -ErrorAction SilentlyContinue | where {$_.DriveType -like $DriveType}
if ($blv.MountPoint -like "?:") {
$vol = Get-Volume -DriveLetter ($blv.MountPoint).TrimEnd(":") -ErrorAction SilentlyContinue | Where-Object {$_.DriveType -like $DriveType}
} else {
$vol = Get-Volume -Path $blv.MountPoint -ErrorAction SilentlyContinue | Where-Object {$_.DriveType -like $DriveType}
}

if ($vol -ne $null)
{
Expand Down

0 comments on commit a4399b9

Please sign in to comment.