PoshCode Archive  Artifact [f5905c6988]

Artifact f5905c69889b4aa26a80024cf8c7e112f17c63399fd83595ae521236e4e3cf45:

  • File Enable-Disable-FusionLog.ps1 — part of check-in [35db00eb65] at 2018-06-10 13:05:08 on branch trunk — http://georgemauer.net/blog/enabledisable-fusionlog-powershell-script/ (user: George Mauer size: 1108)

# encoding: ascii
# api: powershell
# title: Enable/Disable FusionLog
# description: http://georgemauer.net/blog/enabledisable-fusionlog-powershell-script/
# version: 0.1
# type: function
# author: George Mauer
# license: CC0
# x-poshcode-id: 2107
# x-archived: 2013-02-22T07:56:54
# x-published: 2013-08-25T13:46:00
#
# 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.
#
function global:Enable-FusionLog {  
    Remove-ItemProperty HKLM:Software\Microsoft\Fusion -name EnableLog -ErrorAction SilentlyContinue  
    [void](New-ItemProperty  HKLM:Software\Microsoft\Fusion -name EnableLog -propertyType dword -ErrorAction Stop)  
    Set-ItemProperty  HKLM:Software\Microsoft\Fusion -name EnableLog -value 1 -ErrorAction Stop  
    Write-Host "Fusion log enabled.  Do not forget to disable it when you are done"  
}  
function global:Disable-FusionLog {  
    Remove-ItemProperty HKLM:Software\Microsoft\Fusion -name EnableLog -ErrorAction SilentlyContinue  
    Write-Host "Fusion log disabled"  
}