Skip to main content

Worklet: Invoke Troubleshootingpack Bluetooth


JasonG-Automox

Invokes Microsofts builtin repairs for the bluetooth service. I also added a restart of the bluetooth service.
Only run this manually
• Under Evaluation Code:

If (Test-Path "$env:allusersprofile\SoftwareDistribution")
{
Exit 0

}
Else {
Exit 1
}

• Under Remediation Code:

$logfile = "C:\Temp\"
Get-Service -name bthserv | Restart-Service -Force
$service = (Get-Service -name bthserv).name

#check the status of the service to make sure it's started
    $service_status = (Get-Service -name $service).Status
    #if service is running
    if ($service_status -eq 'Stopped')
    
    {

    #start service again
    Start-Service -Name $service
    Start-Sleep -seconds 5

    }   
        #check if service is running again
    if (((Get-Service -name $service).Status) -eq 'Running')
    {
    }
        Else 
        {
        Echo 1
    }
Get-TroubleshootingPack -path "C:\Windows\Diagnostics\System\bluetooth" | Invoke-TroubleshootingPack -Unattended -Result $logfile

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings