Disconnect-XboxDebugger.ps1
function Disconnect-XboxDebugger { begin { if (-not (Test-Path Variable:\XapDmConnectDebugger)) { $Script:XapDmConnectDebugger = Add-Type -Name "Xap$(Get-Random)" ' [DllImport("xbdm.dll")] static extern int DmConnectDebugger(bool connected); ', ' public static int ConnectDebugger() { return DmConnectDebugger(true); }',' public static int DisconnectDebugger() { return DmConnectDebugger(false); } ' -PassThru } } process { $result = $Script:XapDmConnectDebugger::DisconnectDebugger() $resultError = ($xbdm)::DmTranslateError($Result) if ($resultError) { Write-Error $resultError } } } |