Skip to content

Commit af3361e

Browse files
authored
Merge pull request #46 from PowerShell/dev
Release of version 1.4.0.0 of xBitlocker
2 parents 2facc14 + ebb676e commit af3361e

File tree

9 files changed

+154
-161
lines changed

9 files changed

+154
-161
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## Unreleased
44

5+
## 1.4.0.0
6+
7+
- Change double quoted string literals to single quotes
8+
- Add spaces between array members
9+
- Add spaces between variable types and variable names
10+
- Add spaces between comment hashtag and comments
11+
- Explicitly removed extra hidden files from release package
12+
513
## 1.3.0.0
614

715
- Update appveyor.yml to use the default template.

DSCResources/MSFT_xBLAutoBitlocker/MSFT_xBLAutoBitlocker.psm1

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function Get-TargetResource
8787
param
8888
(
8989
[Parameter(Mandatory = $true)]
90-
[ValidateSet("Fixed","Removable")]
90+
[ValidateSet('Fixed', 'Removable')]
9191
[System.String]
9292
$DriveType,
9393

@@ -96,7 +96,7 @@ function Get-TargetResource
9696
$MinDiskCapacityGB,
9797

9898
[Parameter(Mandatory = $true)]
99-
[ValidateSet("PasswordProtector","RecoveryPasswordProtector","StartupKeyProtector","TpmProtector")]
99+
[ValidateSet('PasswordProtector', 'RecoveryPasswordProtector', 'StartupKeyProtector', 'TpmProtector')]
100100
[System.String]
101101
$PrimaryProtector,
102102

@@ -113,7 +113,7 @@ function Get-TargetResource
113113
$AutoUnlock = $false,
114114

115115
[Parameter()]
116-
[ValidateSet("Aes128","Aes256")]
116+
[ValidateSet('Aes128', 'Aes256')]
117117
[System.String]
118118
$EncryptionMethod,
119119

@@ -170,7 +170,7 @@ function Get-TargetResource
170170
$UsedSpaceOnly
171171
)
172172

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

176176
Assert-HasPrereqsForBitlocker
@@ -270,7 +270,7 @@ function Set-TargetResource
270270
param
271271
(
272272
[Parameter(Mandatory = $true)]
273-
[ValidateSet("Fixed","Removable")]
273+
[ValidateSet('Fixed', 'Removable')]
274274
[System.String]
275275
$DriveType,
276276

@@ -279,7 +279,7 @@ function Set-TargetResource
279279
$MinDiskCapacityGB,
280280

281281
[Parameter(Mandatory = $true)]
282-
[ValidateSet("PasswordProtector","RecoveryPasswordProtector","StartupKeyProtector","TpmProtector")]
282+
[ValidateSet('PasswordProtector', 'RecoveryPasswordProtector', 'StartupKeyProtector', 'TpmProtector')]
283283
[System.String]
284284
$PrimaryProtector,
285285

@@ -296,7 +296,7 @@ function Set-TargetResource
296296
$AutoUnlock = $false,
297297

298298
[Parameter()]
299-
[ValidateSet("Aes128","Aes256")]
299+
[ValidateSet('Aes128', 'Aes256')]
300300
[System.String]
301301
$EncryptionMethod,
302302

@@ -353,7 +353,7 @@ function Set-TargetResource
353353
$UsedSpaceOnly
354354
)
355355

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

359359
Assert-HasPrereqsForBitlocker
@@ -366,13 +366,13 @@ function Set-TargetResource
366366
}
367367
else
368368
{
369-
Remove-FromPSBoundParametersUsingHashtable -PSBoundParametersIn $PSBoundParameters -ParamsToRemove "DriveType","MinDiskCapacityGB"
370-
Add-ToPSBoundParametersFromHashtable -PSBoundParametersIn $PSBoundParameters -ParamsToAdd @{"MountPoint" = ""}
369+
Remove-FromPSBoundParametersUsingHashtable -PSBoundParametersIn $PSBoundParameters -ParamsToRemove 'DriveType', 'MinDiskCapacityGB'
370+
Add-ToPSBoundParametersFromHashtable -PSBoundParametersIn $PSBoundParameters -ParamsToAdd @{'MountPoint' = ''}
371371

372-
#Loop through each potential AutoBitlocker volume, see whether they are enabled for Bitlocker, and if not, enable it
372+
# Loop through each potential AutoBitlocker volume, see whether they are enabled for Bitlocker, and if not, enable it
373373
foreach ($key in $autoBlVols.Keys)
374374
{
375-
$PSBoundParameters["MountPoint"] = $key
375+
$PSBoundParameters['MountPoint'] = $key
376376

377377
$testResult = Test-BitlockerEnabled @PSBoundParameters
378378

@@ -474,7 +474,7 @@ function Test-TargetResource
474474
param
475475
(
476476
[Parameter(Mandatory = $true)]
477-
[ValidateSet("Fixed","Removable")]
477+
[ValidateSet('Fixed', 'Removable')]
478478
[System.String]
479479
$DriveType,
480480

@@ -483,7 +483,7 @@ function Test-TargetResource
483483
$MinDiskCapacityGB,
484484

485485
[Parameter(Mandatory = $true)]
486-
[ValidateSet("PasswordProtector","RecoveryPasswordProtector","StartupKeyProtector","TpmProtector")]
486+
[ValidateSet('PasswordProtector', 'RecoveryPasswordProtector', 'StartupKeyProtector', 'TpmProtector')]
487487
[System.String]
488488
$PrimaryProtector,
489489

@@ -500,7 +500,7 @@ function Test-TargetResource
500500
$AutoUnlock = $false,
501501

502502
[Parameter()]
503-
[ValidateSet("Aes128","Aes256")]
503+
[ValidateSet('Aes128', 'Aes256')]
504504
[System.String]
505505
$EncryptionMethod,
506506

@@ -557,7 +557,7 @@ function Test-TargetResource
557557
$UsedSpaceOnly
558558
)
559559

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

563563
Assert-HasPrereqsForBitlocker
@@ -574,13 +574,13 @@ function Test-TargetResource
574574
}
575575
else
576576
{
577-
Remove-FromPSBoundParametersUsingHashtable -PSBoundParametersIn $PSBoundParameters -ParamsToRemove "DriveType","MinDiskCapacityGB"
578-
Add-ToPSBoundParametersFromHashtable -PSBoundParametersIn $PSBoundParameters -ParamsToAdd @{"MountPoint" = ""}
577+
Remove-FromPSBoundParametersUsingHashtable -PSBoundParametersIn $PSBoundParameters -ParamsToRemove 'DriveType', 'MinDiskCapacityGB'
578+
Add-ToPSBoundParametersFromHashtable -PSBoundParametersIn $PSBoundParameters -ParamsToAdd @{'MountPoint' = ''}
579579

580-
#Check whether any potential AutoBitlocker volume is not currently enabled for Bitlocker, or doesn't have the correct settings
580+
# Check whether any potential AutoBitlocker volume is not currently enabled for Bitlocker, or doesn't have the correct settings
581581
foreach ($key in $autoBlVols.Keys)
582582
{
583-
$PSBoundParameters["MountPoint"] = $key
583+
$PSBoundParameters['MountPoint'] = $key
584584

585585
$testResult = Test-BitlockerEnabled @PSBoundParameters -VerbosePreference $VerbosePreference
586586

@@ -684,7 +684,7 @@ function Get-AutoBitlockerStatus
684684
param
685685
(
686686
[Parameter(Mandatory = $true)]
687-
[ValidateSet("Fixed","Removable")]
687+
[ValidateSet('Fixed', 'Removable')]
688688
[System.String]
689689
$DriveType,
690690

@@ -693,7 +693,7 @@ function Get-AutoBitlockerStatus
693693
$MinDiskCapacityGB,
694694

695695
[Parameter(Mandatory = $true)]
696-
[ValidateSet("PasswordProtector","RecoveryPasswordProtector","StartupKeyProtector","TpmProtector")]
696+
[ValidateSet('PasswordProtector', 'RecoveryPasswordProtector', 'StartupKeyProtector', 'TpmProtector')]
697697
[System.String]
698698
$PrimaryProtector,
699699

@@ -710,7 +710,7 @@ function Get-AutoBitlockerStatus
710710
$AutoUnlock = $false,
711711

712712
[Parameter()]
713-
[ValidateSet("Aes128","Aes256")]
713+
[ValidateSet('Aes128', 'Aes256')]
714714
[System.String]
715715
$EncryptionMethod,
716716

@@ -767,19 +767,19 @@ function Get-AutoBitlockerStatus
767767
$UsedSpaceOnly
768768
)
769769

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

773-
#Filter on size if it was specified
774-
if ($PSBoundParameters.ContainsKey("MinDiskCapacityGB"))
773+
# Filter on size if it was specified
774+
if ($PSBoundParameters.ContainsKey('MinDiskCapacityGB'))
775775
{
776776
$allBlvs = $allBlvs | Where-Object -FilterScript {$_.CapacityGB -ge $MinDiskCapacityGB}
777777
}
778778

779-
#Now find disks of the appropriate drive type, and add them to the collection
779+
# Now find disks of the appropriate drive type, and add them to the collection
780780
if ($null -ne $allBlvs)
781781
{
782-
[Hashtable]$returnValue = @{}
782+
[Hashtable] $returnValue = @{}
783783

784784
# Convert DriveType into values returned by Win32_EncryptableVolume.VolumeType
785785
switch ($DriveType)
@@ -813,7 +813,7 @@ function Get-AutoBitlockerStatus
813813

814814
if ($null -ne $vol)
815815
{
816-
[Hashtable]$props = @{
816+
[Hashtable] $props = @{
817817
VolumeStatus = $blv.VolumeStatus
818818
KeyProtectors = $blv.KeyProtector
819819
EncryptionMethod = $blv.EncryptionMethod

DSCResources/MSFT_xBLBitlocker/MSFT_xBLBitlocker.psm1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function Get-TargetResource
8787
$MountPoint,
8888

8989
[Parameter(Mandatory = $true)]
90-
[ValidateSet("PasswordProtector","RecoveryPasswordProtector","StartupKeyProtector","TpmProtector")]
90+
[ValidateSet('PasswordProtector', 'RecoveryPasswordProtector', 'StartupKeyProtector', 'TpmProtector')]
9191
[System.String]
9292
$PrimaryProtector,
9393

@@ -108,7 +108,7 @@ function Get-TargetResource
108108
$AutoUnlock = $false,
109109

110110
[Parameter()]
111-
[ValidateSet("Aes128","Aes256")]
111+
[ValidateSet('Aes128', 'Aes256')]
112112
[System.String]
113113
$EncryptionMethod,
114114

@@ -165,7 +165,7 @@ function Get-TargetResource
165165
$UsedSpaceOnly
166166
)
167167

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

171171
Assert-HasPrereqsForBitlocker
@@ -265,7 +265,7 @@ function Set-TargetResource
265265
$MountPoint,
266266

267267
[Parameter(Mandatory = $true)]
268-
[ValidateSet("PasswordProtector","RecoveryPasswordProtector","StartupKeyProtector","TpmProtector")]
268+
[ValidateSet('PasswordProtector', 'RecoveryPasswordProtector', 'StartupKeyProtector', 'TpmProtector')]
269269
[System.String]
270270
$PrimaryProtector,
271271

@@ -286,7 +286,7 @@ function Set-TargetResource
286286
$AutoUnlock = $false,
287287

288288
[Parameter()]
289-
[ValidateSet("Aes128","Aes256")]
289+
[ValidateSet('Aes128', 'Aes256')]
290290
[System.String]
291291
$EncryptionMethod,
292292

@@ -343,7 +343,7 @@ function Set-TargetResource
343343
$UsedSpaceOnly
344344
)
345345

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

349349
Assert-HasPrereqsForBitlocker
@@ -441,7 +441,7 @@ function Test-TargetResource
441441
$MountPoint,
442442

443443
[Parameter(Mandatory = $true)]
444-
[ValidateSet("PasswordProtector","RecoveryPasswordProtector","StartupKeyProtector","TpmProtector")]
444+
[ValidateSet('PasswordProtector', 'RecoveryPasswordProtector', 'StartupKeyProtector', 'TpmProtector')]
445445
[System.String]
446446
$PrimaryProtector,
447447

@@ -462,7 +462,7 @@ function Test-TargetResource
462462
$AutoUnlock = $false,
463463

464464
[Parameter()]
465-
[ValidateSet("Aes128","Aes256")]
465+
[ValidateSet('Aes128', 'Aes256')]
466466
[System.String]
467467
$EncryptionMethod,
468468

@@ -519,7 +519,7 @@ function Test-TargetResource
519519
$UsedSpaceOnly
520520
)
521521

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

525525
Assert-HasPrereqsForBitlocker

DSCResources/MSFT_xBLTpm/MSFT_xBLTpm.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function Get-TargetResource
4242
$AllowImmediateReboot = $false
4343
)
4444

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

4848
Assert-HasPrereqsForBitlocker
@@ -109,7 +109,7 @@ function Set-TargetResource
109109
$AllowImmediateReboot = $false
110110
)
111111

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

115115
Assert-HasPrereqsForBitlocker
@@ -185,7 +185,7 @@ function Test-TargetResource
185185
$AllowImmediateReboot = $false
186186
)
187187

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

191191
Assert-HasPrereqsForBitlocker
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Configuration ConfigureBitlockerAndAutoBitlocker
22
{
3-
Import-DscResource ModuleName PSDesiredStateConfiguration
3+
Import-DscResource -ModuleName PSDesiredStateConfiguration
44
Import-DscResource -ModuleName xBitlocker
55

6-
Node 'E15-1'
6+
Node 'localhost'
77
{
8-
#First install the required Bitlocker features
8+
# First install the required Bitlocker features
99
WindowsFeature BitlockerFeature
1010
{
1111
Name = 'Bitlocker'
@@ -20,7 +20,7 @@ Configuration ConfigureBitlockerAndAutoBitlocker
2020
IncludeAllSubFeature = $true
2121
}
2222

23-
#This example enables Bitlocker on the Operating System drive using both a RecoveryPasswordProtector and a StartupKeyProtector
23+
# This example enables Bitlocker on the Operating System drive using both a RecoveryPasswordProtector and a StartupKeyProtector
2424
xBLBitlocker Bitlocker
2525
{
2626
MountPoint = 'C:'
@@ -31,22 +31,20 @@ Configuration ConfigureBitlockerAndAutoBitlocker
3131
AllowImmediateReboot = $true
3232
UsedSpaceOnly = $true
3333

34-
DependsOn = '[WindowsFeature]BitlockerFeature','[WindowsFeature]BitlockerToolsFeature'
34+
DependsOn = '[WindowsFeature]BitlockerFeature', '[WindowsFeature]BitlockerToolsFeature'
3535
}
3636

37-
#This example sets up AutoBitlocker for any drive of type Fixed with a RecoveryPasswordProtector only.
37+
# This example sets up AutoBitlocker for any drive of type Fixed with a RecoveryPasswordProtector only.
3838
xBLAutoBitlocker AutoBitlocker
3939
{
4040
DriveType = 'Fixed'
4141
PrimaryProtector = 'RecoveryPasswordProtector'
4242
RecoveryPasswordProtector = $true
4343
UsedSpaceOnly = $true
44-
45-
DependsOn = '[xBLBitlocker]Bitlocker' #Don't enable AutoBL until the OS drive has been encrypted
44+
# Don't enable AutoBL until the OS drive has been encrypted
45+
DependsOn = '[xBLBitlocker]Bitlocker'
4646
}
4747
}
4848
}
4949

5050
ConfigureBitlockerAndAutoBitlocker
51-
52-
#Start-DscConfiguration -Verbose -Wait -Path .\ConfigureBitlockerAndAutoBitlocker -ComputerName "E15-1"

0 commit comments

Comments
 (0)