为powershell提取命令行日志,我们添加了变量
#$LogCommandHealthEvent = $true
#$LogCommandLifeCycleEvent = $true
它的效果很好但是什么是'提示'
Time Event Command
---- ----- -------
5/27/2016 1:38:31 PM 501 prompt
5/27/2016 1:38:31 PM 500 prompt
5/27/2016 1:38:31 PM 501 get-process
5/27/2016 1:38:31 PM 500 get-process
5/27/2016 1:38:29 PM 501 prompt
5/27/2016 1:38:29 PM 500 prompt
5/27/2016 1:38:29 PM 501 ipconfig
这确实出现在日志中的eventdata中 - faa69d45087e PipelineId = 608 CommandName = prompt CommandType = Function ScriptName = CommandPath = CommandLine = prompt
答案 0 :(得分:1)
The Prompt function determines the appearance of the Windows PowerShell prompt. Windows PowerShell comes with a built-in Prompt function, but you can override it by defining your own Prompt function. ... BUILT-IN PROMPT Windows PowerShell includes a built-in prompt function. In Windows PowerShell 3.0, the built-in prompt function is:
function prompt
{
"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "
}
其他详情: