Scripting of ListChildFolder and compareTwoFiles

Capture
Please Help Me How To Script this Into PowerShell

Test Case: Create powershell function
List child folder
• Scriptname: listChildFolder
• Input: full path parent folder
• Output: list of child folder name, sort by Date Modified, descending
• Sample input: “D:\Test”
• Sample output:
:black_small_square: If show some results = “Folder1”,“Folder2”,“Sample Folder 3”
:black_small_square: If show empty = “Folder empty”
:black_small_square: If problem happen = “Error: ”

Compare file size
• Scriptname: compareTwoFiles
• Input: full path of file1, full path of file 2
• Output: filename that has bigger size
• Sample input: “D:\Test\File 1”, “D:\Test\File 2”,
• Sample output:
:black_small_square: If one file has bigger size: “File 1”
:black_small_square: If both has same size: “both file has same size”

Hi, welcome to the forum :wave:

If this a college assignment or homework question the first port of call should be your tutor.

3 Likes