#requires -Version 5.1 <# .SYNOPSIS Turn test-signing back off after you are done with the virtual Kinect (legacy usbip-win path). .DESCRIPTION [~] BLOCKED in the kinect build environment (no Windows). RUN THIS ON THE USER'S WINDOWS BOX, elevated. WARNING: Do NOT run this while the test-signed usbip-win VHCI driver is still installed and in use. Disabling test-signing with a test-signed driver still bound will stop every USB device attached through it from working. Detach all Kinect busids (Detach-Kinect.ps1) and uninstall the VHCI driver ('usbip.exe uninstall') FIRST, then run this and reboot. #> [CmdletBinding()] param() $ErrorActionPreference = 'Stop' $id = [Security.Principal.WindowsIdentity]::GetCurrent() $principal = New-Object Security.Principal.WindowsPrincipal($id) if (-not $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { throw 'This script must run in an elevated PowerShell (Run as Administrator).' } Write-Host 'Disabling test-signing: bcdedit /set testsigning off' -ForegroundColor Green bcdedit.exe /set testsigning off if ($LASTEXITCODE -ne 0) { throw 'bcdedit /set testsigning off failed.' } Write-Host 'Done. Reboot to apply. Re-enable Secure Boot in firmware if you turned it off.' -ForegroundColor Cyan