# encoding: ascii
# api: powershell
# title:  
# description: kills trustedinstaller
# version: 0.1
# type: function
# author: LunaHex
# license: CC0
# x-poshcode-id: 6227
# x-archived: 2016-08-26T03:50:02
# x-published: 2016-02-19T21:18:00
#
#
function killItWithFire {
  $TrustedInstallerProcess = Get-Process -ProcessName trustedinstaller
  if($TrustedInstallerProcess){
    Write-Host -ForegroundColor GREEN "TrustedInstaller process is running, killing it now."
    Stop-Process $TrustedInstallerProcess.Id -Force
  } else {
    Write-Host "TrustedInstaller process is not running."
  }
  $TrustedInstallerService = Get-Service trustedinstaller
  if($TrustedInstallerService.status -eq "Running"){
    Write-Host -ForegroundColor GREEN "TrustedInstaller service is running, stopping it now."
    Set-Service $TrustedInstallerService.name -Status stopped
  }
  Write-Host -ForegroundColor GREEN "Disabling TrustedInstaller service."
  Set-Service $TrustedInstallerService.name -StartupType Disabled
}
killItWithFire
