Skip to content

Commit 3b3b6dd

Browse files
committed
Init Disable-BitLocker
See SYNOPSIS/DESCRIPTION
1 parent 42d1d1c commit 3b3b6dd

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Function Disable-BitLocker {
2+
<#
3+
.SYNOPSIS
4+
Disables BitLocker on the specified drive.
5+
6+
.DESCRIPTION
7+
This function disables BitLocker encryption on the specified drive, it checks the current status of BitLocker on the drive and if it's enabled, it proceeds to disable BitLocker.
8+
9+
.PARAMETER MountPoint
10+
Mandatory - the drive letter or mount point for which BitLocker will be disabled.
11+
12+
.EXAMPLE
13+
Disable-BitLocker -MountPoint "C:"
14+
15+
.NOTES
16+
v0.0.1
17+
#>
18+
[CmdletBinding()]
19+
param (
20+
[Parameter(Mandatory = $true)]
21+
[string]$MountPoint
22+
)
23+
$DriveInfo = Get-BitLockerVolume -MountPoint $MountPoint
24+
if ($DriveInfo.ProtectionStatus -eq "On") {
25+
Disable-BitLockerVolume -MountPoint $MountPoint -Confirm:$false
26+
Write-Host "BitLocker has been disabled on drive $MountPoint" -ForegroundColor Green
27+
}
28+
else {
29+
Write-Host "BitLocker is already disabled on drive $MountPoint" -ForegroundColor Yellow
30+
}
31+
}

0 commit comments

Comments
 (0)