In: Computer Science
For this assignment, you will need any computer running PowerShell v5 or later. Your answer should only include the function or the script files that generate the results.
solution;
script.ps1
***********
$path = "C:\Windows\System32\winevt\Logs"
$destination = "C:\Users\Administrator\Desktop\output.txt"
$results = Get-ChildItem $path -Recurse | where {$_.extension
-in ".evtx"} | Where-Object {$_.length/1MB -gt 1} | Select-Object
Name, Extension, @{Name="Mbytes";Expression={ "{0:N0}" -f
($_.Length / 1mb) }}
$results | sort LastWriteTime -Descending | Out-File
$destination