This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
script:powershell:bitlocker [2020/06/28 09:56] 127.0.0.1 external edit |
script:powershell:bitlocker [2020/08/10 23:07] (current) |
||
---|---|---|---|
Line 6: | Line 6: | ||
==== La version avec CIMInstance ==== | ==== La version avec CIMInstance ==== | ||
- | <file PowerShell> | + | <sxh PowerShell> |
$WinDrive = ($env:windir.Replace('\WINDOWS','')) | $WinDrive = ($env:windir.Replace('\WINDOWS','')) | ||
$WMIVolume = Get-CimInstance -namespace "Root\cimv2\security\MicrosoftVolumeEncryption" -ClassName "Win32_Encryptablevolume" | Where-Object DriveLetter -eq $($WinDrive) | $WMIVolume = Get-CimInstance -namespace "Root\cimv2\security\MicrosoftVolumeEncryption" -ClassName "Win32_Encryptablevolume" | Where-Object DriveLetter -eq $($WinDrive) | ||
Line 17: | Line 17: | ||
Write-Output "Bitlocker is not enabled on $WinDrive" | Write-Output "Bitlocker is not enabled on $WinDrive" | ||
} | } | ||
- | </file> | + | </sxh> |
==== La version avec le commandlet Get-BitLockerVolume ==== | ==== La version avec le commandlet Get-BitLockerVolume ==== | ||
- | <file PowerShell> | + | <sxh PowerShell> |
$BitLockerVolume = Get-BitLockerVolume | $BitLockerVolume = Get-BitLockerVolume | ||
$BitLockerVolume | $BitLockerVolume | ||
Line 32: | Line 32: | ||
Write-Output "Bitlocker is not enabled on $WinDrive" | Write-Output "Bitlocker is not enabled on $WinDrive" | ||
} | } | ||
- | </file> | + | </sxh> |
===== Conclusion ===== | ===== Conclusion ===== | ||
Il n'y a pas d'avantage à utiliser cette commandlet, elle n'est pratique que lorsque vous voulez consulter en "1-shot" cette information sur votre poste, sinon dans un script, elle sera donc inutile. | Il n'y a pas d'avantage à utiliser cette commandlet, elle n'est pratique que lorsque vous voulez consulter en "1-shot" cette information sur votre poste, sinon dans un script, elle sera donc inutile. | ||