Question

In: Computer Science

For this assignment, you will need any computer running PowerShell v5 or later. Your answer should...

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.

  1. For this question, your challenge is to create a PowerShell function that accesses all the log files stored under C:\Windows\System32\winevt\Logs. The function should display only those event logs whose size is more than 1MB. Sort the result by LastWriteTime in descending order.

Solutions

Expert 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


if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)


Related Solutions

For this assignment, you will need any computer running PowerShell v5 or later. Your answer should...
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. The Get-ChildItem cmdlet is very useful in obtaining files and directory information. Your challenge is to create a PowerShell function that displays all ‘.exe’ and ‘.dll’ files stored under C:\Windows\System32, whose size is more than 5 MB. Group the files based on their extension and store the list into a text file.
The Lab For this assignment, you need access to a computer running Windows 7, Windows 10...
The Lab For this assignment, you need access to a computer running Windows 7, Windows 10 or a current operating system. Create a folder that contains two subfolders and five files of different types. Each subfolder should have at least three files. Apply each of the NTFS standard permissions to the first folder you created, and allow the permissions to be inherited. Record and report the effects of each change.
Assignment- [ A4]:  For this assignment you need to answer all the questions: Every productive activity involves...
Assignment- [ A4]:  For this assignment you need to answer all the questions: Every productive activity involves some combination of different categories of scarce resource. Think of your OWN business proposed to start in 2021. Q1. Which among the following economic system would easily overcome the economic crisis that caused during Covid 19 pandemic?                 a.     Capitalist economy b.     Socialist economy c.     Mixed economy You are required to build and justify three arguments in favor and against of the selected economic system.                             (6+6 Marks) Q2. According...
Use the data below to answer the questions in this assignment. You will first need to...
Use the data below to answer the questions in this assignment. You will first need to enter the following data in SPSS with “age” and “hours” as your variable names. Age and Hours on Computer Data Age (X): 24, 23, 23,25,27, 21,21,30,21,29 Number of hours on spent on computer per week (Y): 14,24,18,23,19,23,16,10,6,15 This question is only being used to describe the data set. In the box below you only need to enter 0. Run a correlation analysis in SPSS...
I need some assistance with the following assignment: Cron is a system daemon running in the...
I need some assistance with the following assignment: Cron is a system daemon running in the background helping you schedule and execute tasks such as system backups. In this lab you will learn how to schedule backups with user and system cron tables. Submit a report that lists the commands that you would use to accomplish the following tasks: Check the status of a cron daemon Stop and terminate a cron daemon Start and run a cron daemon Restart a...
Five years later, you are offered your dream job in Costa Rica. You need to sell...
Five years later, you are offered your dream job in Costa Rica. You need to sell this house in order to purchase a new one where you are moving. Rents have increased since you purchased the home and you estimate that the home will rent for $20,400 per year (net). You have found a high quality tenant willing to sign a five year lease under the following conditions. Rent will be $$20,400 each year for the first three years, and...
Until now, you have had to leave your team management program running on your computer indefinitely...
Until now, you have had to leave your team management program running on your computer indefinitely since you did not want to lose the list of players. Finally, you are ready to add the components to your team management program that will allow you to store the player’s information on your computer’s hard drive, thus, allow you to shut down your program without losing your data. You will need to modify your program to: include a Save option in the...
Should genetic screening or testing be mandatory for any disease? Support your answer.
Should genetic screening or testing be mandatory for any disease? Support your answer.
You need a new computer. You are considering either leasing or putting the purchase on your...
You need a new computer. You are considering either leasing or putting the purchase on your credit card. The terms of the lease agreement are $250 down and a monthly payment of $100 for 12 months, with an option to purchase for $300 at the end of the lease period. If you buy the computer now and put the purchase on your credit card, your monthly payment would be $130, with the credit card interest rate 18% compounded monthly. What...
You may need to use the appropriate technology to answer this question. To test for any...
You may need to use the appropriate technology to answer this question. To test for any significant difference in the number of hours between breakdowns for four machines, the following data were obtained. Machine 1 Machine 2 Machine 3 Machine 4 6.5 9.0 11.0 9.8 7.9 7.6 10.2 12.5 5.4 9.6 9.4 11.9 7.6 10.4 10.0 10.6 8.6 9.6 8.9 11.2 7.8 10.2 8.7 11.2 (a) At the α = 0.05 level of significance, what is the difference, if any,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT