-
Notifications
You must be signed in to change notification settings - Fork 0
/
MicCheck
22 lines (19 loc) · 830 Bytes
/
MicCheck
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Check if Microphone setting exists in the BIOS and capture its value
$microphoneSetting = Get-WmiObject -Namespace root/hp/instrumentedBIOS -Class hp_biosEnumeration | Where-Object { $_.Name -eq "Microphone" }
if ($microphoneSetting) {
# Retrieve the current value of the Microphone BIOS setting
$microphoneValue = $microphoneSetting.CurrentValue
# Log the current value for tracking
Write-Host "Microphone BIOS setting found. Current Value: $microphoneValue"
# Exit with 0 if enabled, 1 if not enabled
if ($microphoneValue -eq "Enabled") {
Write-Host "Microphone is enabled."
exit 0
} else {
Write-Host "Microphone is not enabled (Disabled or another state)."
exit 1
}
} else {
Write-Host "Microphone BIOS setting not found. No action taken."
exit 1
}