major update

This commit is contained in:
2021-05-24 14:05:59 -04:00
parent 1d882a7ddc
commit e767d39d85
39 changed files with 43 additions and 2272 deletions
+16
View File
@@ -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 }
}