PoshCode Logo PowerShell Code Repository

Enable/Disable FusionLog by George Mauer 17 months ago
embed code: <script type="text/javascript" src="http://PoshCode.org/embed/2107"></script>download | new post

http://georgemauer.net/blog/enabledisable-fusionlog-powershell-script/

Enabling/disabling your Fusion Log every time you need to figure out why assembly binding has gone wrong is a hassle. So here you go.

  1. function global:Enable-FusionLog {  
  2.     Remove-ItemProperty HKLM:Software\Microsoft\Fusion -name EnableLog -ErrorAction SilentlyContinue  
  3.     [void](New-ItemProperty  HKLM:Software\Microsoft\Fusion -name EnableLog -propertyType dword -ErrorAction Stop)  
  4.     Set-ItemProperty  HKLM:Software\Microsoft\Fusion -name EnableLog -value 1 -ErrorAction Stop  
  5.     Write-Host "Fusion log enabled.  Do not forget to disable it when you are done"  
  6. }  
  7. function global:Disable-FusionLog {  
  8.     Remove-ItemProperty HKLM:Software\Microsoft\Fusion -name EnableLog -ErrorAction SilentlyContinue  
  9.     Write-Host "Fusion log disabled"  
  10. }

Submit a correction or amendment below (
click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:


Remember me