Start the Windows PowerShell ISE. \n2. Use the Get-Verb cmdlet to obtain a listing of approved verbs. \n3. From the list of verbs outputted from #2<\/span>, select a verb that would be appropriate for a \nfunction that obtains a listing of files by date last modified. \n4. Create a new function named Get-FilesByDate. \n5. Add four command-line parameters to the function. The first parameter is an array of file \ntypes, the second is for the month, the third parameter is for the year, and the last parameter is \nan array of file paths. \n6. Add the code to perform a recursive search of paths supplied via the $path variable. Limit \nthe search to include only file types supplied via the $filetypes variable.<\/p>\n\n
Add a Where-Object clause to limit the files returned to the month of the \nlastwritetime property that equals the month supplied via the command line, and the \nyear supplied via the command line.<\/li>\n
Save the function in a .ps1 file named Get-FilesByDate.ps1.<\/li>\n
Add to the script containing the function the commands required to call the function, \nsearching for: \n.docx files, from Month 2, year 2020, in path c:\\Users \n(I didn’t have any .docx files from that month, so I used month = 3, then created an empty file in \nmy documents directory with name “test.docx”)<\/li>\n<\/ol>","upvoteCount":6,"answerCount":7,"datePublished":"2022-03-27T16:47:18.000Z","author":{"@type":"Person","name":"spiceuser-25su3","url":"https://community.spiceworks.com/u/spiceuser-25su3"},"suggestedAnswer":[{"@type":"Answer","text":"
Advertisement
Start the Windows PowerShell ISE. \n2. Use the Get-Verb cmdlet to obtain a listing of approved verbs. \n3. From the list of verbs outputted from #2<\/span>, select a verb that would be appropriate for a \nfunction that obtains a listing of files by date last modified. \n4. Create a new function named Get-FilesByDate. \n5. Add four command-line parameters to the function. The first parameter is an array of file \ntypes, the second is for the month, the third parameter is for the year, and the last parameter is \nan array of file paths. \n6. Add the code to perform a recursive search of paths supplied via the $path variable. Limit \nthe search to include only file types supplied via the $filetypes variable.<\/p>\n\n
Add a Where-Object clause to limit the files returned to the month of the \nlastwritetime property that equals the month supplied via the command line, and the \nyear supplied via the command line.<\/li>\n
Save the function in a .ps1 file named Get-FilesByDate.ps1.<\/li>\n
Add to the script containing the function the commands required to call the function, \nsearching for: \n.docx files, from Month 2, year 2020, in path c:\\Users \n(I didn’t have any .docx files from that month, so I used month = 3, then created an empty file in \nmy documents directory with name “test.docx”)<\/li>\n<\/ol>","upvoteCount":6,"datePublished":"2022-03-27T16:47:18.000Z","url":"https://community.spiceworks.com/t/need-help-completing-this-asap/828834/1","author":{"@type":"Person","name":"spiceuser-25su3","url":"https://community.spiceworks.com/u/spiceuser-25su3"}},{"@type":"Answer","text":"