给出以下命令如何仅获取where条件后的第一个值?
Get-WinEvent -FilterHashtable @{Logname = 'Security';EndTime=$Time; ID = 5379} |
select id , TimeCreated, @{ n='USER'; E ={ $_.Properties[1].Value}} |
where USER -notlike 'condition'
Run Code Online (Sandbox Code Playgroud)
我试过了-MaxEvents 1,-First 1但这仅适用于Select-Object,不适用于where.
powershell ×1