Created
May 22, 2013 23:24
-
-
Save idavis/5631747 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Enable-FusionLog { | |
param($logPath = "C:\Temp\Fusion") | |
if(!(Test-Path $logPath)) { | |
New-Item -ItemType Directory -Path $logPath | |
} | |
$fusionRoot = "HKLM:Software\Microsoft\Fusion" | |
function Set-FusionKey($name, $value, $type) { | |
if(!(Test-Path (Join-Path $fusionRoot $name))) { | |
(New-ItemProperty $fusionRoot -name $name -propertyType $type -ErrorAction Stop) | Out-Null | |
} | |
Set-ItemProperty $fusionRoot -name $name -value $value -ErrorAction Stop | |
} | |
Set-FusionKey "EnableLog" 1 dword | |
Set-FusionKey "ForceLog" 1 dword | |
Set-FusionKey "LogPath" $logPath string | |
} | |
function Disable-FusionLog { | |
$fusionRoot = "HKLM:Software\Microsoft\Fusion" | |
if(Test-Path (Join-Path $fusionRoot EnableLog)) { | |
Set-ItemProperty $fusionRoot -name EnableLog -Value 0 -ErrorAction Stop | |
Write-Host "Fusion log disabled" | |
} else { | |
Write-Host "Fusion log was not enabled" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment