Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- .DESCRIPTION
- My first script
- AUTHOR
- Ben0xA
- .SYNOPSIS
- This is my first script that I am writing at DerbyCon
- .EXAMPLE
- .\hellowworld.ps1
- #>
- $files = Get-ChildItem "C:\psf" -Recurse
- $list = @()
- #check to see if we have any files before we begin to work with them.
- if($files -ne $null) {
- #loop over each file and check the LastWriteTime
- ForEach($file in $files) {
- if($file.LastWriteTime -ge "6/1/2014 00:00 AM" -and $file.LastWriteTime -le "6/30/2014 11:59 PM") {
- #add the full path to the file to the $list array.
- $list += $file.FullName
- }
- }
- if($list -ne $null -and $list.Length -gt 0) {
- Write-Output $list
- }
- else {
- Write-Output "No files were found matching that criteria."
- }
- }
- else {
- Write-Output "No files were found."
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement