Question
You have a lot of users who dont delete or clean up their files and folders. Youve been asked to create a script that will
You have a lot of users who don’t delete or clean up their files and folders. You’ve been asked to create a script that will examine a file path, along with its subfolders, and produce the following three reports for the user:
- 10 Oldest Files
- 15 Largest Files
- 20 Recently Accessed Files
For each of the reports:
- Obtain the file path to be inspected by the user
- Output the information in the PowerShell console (3 reports = 3 outputs)
- Display a title and description
- Format the information as a list
- Properties should include:
- File name
- Full path to the file
- File size in MB
- Date and Time file or folder was created
- Date and Time file or folder was last changed
- Date and Time file or folder was last accessed
- Properties should include:
- Utilize new lines, ascii characters, colour, and other elements to improve the look of the report
Script Elements:
- Ensure instructions are easy to follow.
- Use of error handling for user input
- Contains no spelling or grammar errors
Part 2: Problem 2
You manager needs to perform an inventory audit report. Write a script that give you the following information while running locally on each machine.
- Computer Name
- OS Version
- Serial Number
- Manufacturer
- Model
- RAM in GB
- C: drive size in GB
- Currently logged-on user
For the report:
- Obtain the location to save the report specified by the user.
- The file type should be specified by the script and can be of your choosing
- Txt, csv, HTML, etc
- The file should be named inventory2022 + file type
- Ex. Inventory2022.txt, inventory2022.csv, inventory2022.html, etc
- Include a title, description, and date/time the script was ran
- Utilize new lines, ASCII characters, color, and other elements to improve the look of the report
Script Elements:
- Ensure instructions are easy to follow.
- Use of error handling for user input
- Contains no spelling or grammar errors
Part 3: All-Together
You have been asked to combine the solutions to your problems into one script with a PowerShell-driven menu.
- Put all your code into one PowerShell script file (.ps1)
- Each question should be within functions to group your code.
- Set it up so when you run it, you will be presented with a menu to execute the specified section
- Ensure your menu is detailed and has descriptions
- Ensure all variable and function names describe their propose
- Use new lines, spacing, and consistency throughout your whole script
- Include an appropriate amount of comments explained in clearly defined sentences
Step by Step Solution
3.46 Rating (175 Votes )
There are 3 Steps involved in it
Step: 1
Part 1 Problem 1 Solution Define the Variables Path ReadHost Please enter the file path to be inspected OldestFiles LargestFiles RecentFiles Define the functions Function GetOldestFiles Get the 10 old...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started