From 90a141b05dc36dd6394ebd30cce41d7610ee9111 Mon Sep 17 00:00:00 2001 From: dyoder Date: Mon, 24 May 2021 14:07:15 -0400 Subject: [PATCH] added functionality to Tools.ps1 --- Set-LogFile.ps1 | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 Set-LogFile.ps1 diff --git a/Set-LogFile.ps1 b/Set-LogFile.ps1 deleted file mode 100644 index 16a14d8..0000000 --- a/Set-LogFile.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -# Function to enable or disable a specified log -function SetLog -{ - param ( - [Parameter(Mandatory = $true)] - [string]$Name, - [Parameter(Mandatory = $true, ParameterSetName = 'Enable')] - [switch]$Enable, - [Parameter(Mandatory = $true, ParameterSetName = 'Disable')] - [switch]$Disable - ) - - # Create a new object for the specified log - $log = New-Object System.Diagnostics.Eventing.Reader.EventLogConfiguration $Name - - # Make the specified change to the log - if ( $Enable ) { $log.IsEnabled = $true } - if ( $Disable ) { $log.IsEnabled = $false } - - # Commit changes to the log - $log.SaveChanges() -} - -SetLog -Name Microsoft-Windows-DNS-Client/Operational -Disable \ No newline at end of file