lapetesson
Active member
During tests of a Windows 11 app writing into the Windows event log, I registered event source XXXYYYZZZ. I can list existing log entries in PowerShell:
However, when I'm trying to remove this event source, I get an error telling me that the source does not exist:
I run PowerShell as an administrator. How do I remove an event source?
This event source is somehow "special" because I could delete another source using the same command.
Code:
PS C:\WINDOWS\system32> Get-EventLog -Source ZZZYYYXXX
cmdlet Get-EventLog at command pipeline position 1
Supply values for the following parameters:
LogName: Application
Index Time EntryType Source InstanceID Message
----- ---- --------- ------ ---------- -------
18312 sep 23 19:02 Information ZZZYYYXXX 0 The description for Event ID '0' in Source 'ZZZ...
18311 sep 23 19:01 Information ZZZYYYXXX 0 The description for Event ID '0' in Source 'ZZZ...
However, when I'm trying to remove this event source, I get an error telling me that the source does not exist:
Code:
PS C:\WINDOWS\system32> Remove-EventLog -Source ZZZYYYXXX
Remove-EventLog : The source name "ZZZYYYXXX" does not exist on computer "localhost".
At line:1 char:1
+ Remove-EventLog -Source ZZZYYYXXX
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Remove-EventLog], InvalidOperationException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.RemoveEventLogCommand
I run PowerShell as an administrator. How do I remove an event source?
This event source is somehow "special" because I could delete another source using the same command.
My Computer
System One
-
- OS
- Windows 11
- Manufacturer/Model
- Beelink SER5 AM06PRO, Acer Aspire A515-43, Lenovo Thinkcentre-m92p