Advertisement
Guest User

Untitled

a guest
Aug 13th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. ## -- Store all bluetooth named services as an array and stop if running, and disable the startup type if it's not already
  2. $BTServices = (Get-Service | ?{$_.DisplayName -match "bluetooth"}).Name;
  3.  
  4. $BTServices | % {
  5. $status = (Get-Service -Name $_).Status;
  6. If($status -ne "Stopped"){Stop-Service $_ -Force};
  7. $sType = (Get-Service -Name $_).StartType;
  8. If($sType -ne "Disabled"){Set-Service $_ -StartupType Disabled};
  9. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement