PoshCode Archive  Artifact [4337b7bac1]

Artifact 4337b7bac1a5c6835625b0a98bc75c029f87b573b5cf3de1338cda5c137a984e:

  • File Enable-Disable-FusionLog.ps1 — part of check-in [c81248e7f7] at 2018-06-10 14:14:10 on branch trunk — http://georgemauer.net/blog/enabledisable-fusionlog-powershell-script/ (user: Inwza678 size: 1104)

# encoding: ascii
# api: powershell
# title: Enable/Disable FusionLog
# description: http://georgemauer.net/blog/enabledisable-fusionlog-powershell-script/
# version: 0.1
# type: function
# author: Inwza678
# license: CC0
# x-poshcode-id: 6367
# x-archived: 2016-06-04T19:06:38
# x-published: 2016-06-03T05:00: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"  
}