Skip to content

Commit f2ae6db

Browse files
committed
Clarify that DisableCamera and DisableMicrophone work system-wide, related to Disassembler0#327
1 parent 0619472 commit f2ae6db

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

Win10.psm1

+16-13
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,8 @@ Function EnableCortana {
387387
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\InputPersonalization" -Name "AllowInputPersonalization" -ErrorAction SilentlyContinue
388388
}
389389

390-
# Disable biometric features in Windows. Note - it's recommended to create a password recovery disk, if you log on using biometrics.
390+
# Disable biometric features
391+
# Note: If you log on using biometrics (fingerprint, Windows Hello etc.) it's recommended to create a password recovery disk before applying this tweak.
391392
Function DisableBiometrics {
392393
Write-Output "Disabling biometric services..."
393394
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Biometrics")) {
@@ -402,33 +403,35 @@ Function EnableBiometrics {
402403
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Biometrics" -Name "Enabled" -ErrorAction SilentlyContinue
403404
}
404405

405-
# Disable access to camera from UWP apps
406+
# Disable access to camera
407+
# Note: This disables access using standard Windows API. Direct access to device will still be allowed.
406408
Function DisableCamera {
407-
Write-Output "Disabling access to camera from UWP apps..."
408-
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Camera")) {
409-
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Camera" -Force | Out-Null
409+
Write-Output "Disabling access to camera..."
410+
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
411+
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
410412
}
411-
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Camera" -Name "AllowCamera" -Type DWord -Value 0
413+
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessCamera" -Type DWord -Value 2
412414
}
413415

414-
# Enable access to camera in UWP apps
416+
# Enable access to camera
415417
Function EnableCamera {
416-
Write-Output "Enabling access to camera from UWP apps..."
417-
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Camera" -Name "AllowCamera" -ErrorAction SilentlyContinue
418+
Write-Output "Enabling access to camera..."
419+
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessCamera" -ErrorAction SilentlyContinue
418420
}
419421

420-
# Disable access to microphone in UWP apps
422+
# Disable access to microphone
423+
# Note: This disables access using standard Windows API. Direct access to device will still be allowed.
421424
Function DisableMicrophone {
422-
Write-Output "Disabling access to microphone in UWP apps..."
425+
Write-Output "Disabling access to microphone..."
423426
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy")) {
424427
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Force | Out-Null
425428
}
426429
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessMicrophone" -Type DWord -Value 2
427430
}
428431

429-
# Enable access to microphone in UWP apps
432+
# Enable access to microphone
430433
Function EnableMicrophone {
431-
Write-Output "Enabling access to microphone from UWP apps..."
434+
Write-Output "Enabling access to microphone..."
432435
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name "LetAppsAccessMicrophone" -ErrorAction SilentlyContinue
433436
}
434437

0 commit comments

Comments
 (0)