admin管理员组文章数量:1388812
I need to find the Event Id that is generated by Windows when it happens
I've tried to search in various websites and docs, but there's nothing about it
Could it be that the Clear-History command doesnt generate an Event Id?
Links that i've tried searching:
Clear-History
Audit Log Clearing
This last one isn't what i need, but i've tried finding in the website, no success
I need to find the Event Id that is generated by Windows when it happens
I've tried to search in various websites and docs, but there's nothing about it
Could it be that the Clear-History command doesnt generate an Event Id?
Links that i've tried searching:
Clear-History
Audit Log Clearing
This last one isn't what i need, but i've tried finding in the website, no success
Share Improve this question asked Mar 15 at 16:34 Eric KenjiEric Kenji 11 silver badge 1 |1 Answer
Reset to default 1Could it be that the Clear-History command doesn't generate an Event Id?
Indeed it doesn't.[1]
Given that Clear-History
's purpose is to clear the history of recently executed interactive commands, something that exists purely for user-specific, interactive convenience, it isn't surprising that no event-log entry is created when it is invoked.
As an aside:
Clear-History
alone isn't actually enough to clear the command history in PowerShell versions since v5 (including PowerShell (Core) 7), given that these versions ship with thePSReadLine
module that maintains its own history: see this answer.
[1] Neither the linked help topic mentions event logs nor does the source code. While the source code, strictly speaking, applies only to PowerShell (Core) 7 (the modern, cross-platform, install-on-demand edition), not also to the closed-source Windows PowerShell (the legacy, ships-with-Windows, Windows-only edition of PowerShell whose latest and last version is 5.1), the former's source code was forked from the latter's, and it's unlikely that changes were made in this area since.
本文标签: windowsWhat is the Event ID or Reference ID for ClearHistoryStack Overflow
版权声明:本文标题:windows - What is the Event ID or Reference ID for Clear-History - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744608700a2615518.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
Clear-History
cmdlet. – mklement0 Commented Mar 15 at 21:10