major update
This commit is contained in:
@@ -426,4 +426,20 @@ Function Create-Shortcut {
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
Else { LogMsg "Cannot create shortcut because the target path does not exist" }
|
||||
}
|
||||
|
||||
# Function to enable or disable a specified log
|
||||
function Toggle-Log {
|
||||
param (
|
||||
[Parameter(Mandatory = $true)][string]$Name,
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'Enable')][switch]$Enable,
|
||||
[Parameter(Mandatory = $true, ParameterSetName = 'Disable')][switch]$Disable
|
||||
)
|
||||
Try {
|
||||
$log = New-Object System.Diagnostics.Eventing.Reader.EventLogConfiguration $Name
|
||||
If ( $Enable ) { $log.IsEnabled = $true }
|
||||
If ( $Disable ) { $log.IsEnabled = $false }
|
||||
$log.SaveChanges()
|
||||
}
|
||||
Catch { LogMsg $_.Exception.Message }
|
||||
}
|
||||
Reference in New Issue
Block a user