Skip to content

Instantly share code, notes, and snippets.

@idavis
Created May 22, 2013 23:24
Show Gist options
  • Save idavis/5631747 to your computer and use it in GitHub Desktop.
Save idavis/5631747 to your computer and use it in GitHub Desktop.
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