Skip to content

Commit

Permalink
Merge pull request #29 from iricigor/PS2Compatibility
Browse files Browse the repository at this point in the history
PSv2IssuesResolved
  • Loading branch information
iricigor authored Oct 10, 2018
2 parents 8ce70bf + 006b768 commit 8674895
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Get-FolderAge.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
class FolderAgeResult {
# class FolderAgeResult {

[string]$Path
[datetime]$LastWriteTime
[Nullable[boolean]]$Modified
# [string]$Path
# [datetime]$LastWriteTime
# [Nullable[boolean]]$Modified

# TODO: Add something like confident bool
# TODO: Add some diagnostics, like folders/files processed
}
# # TODO: Add something like confident bool
# # TODO: Add some diagnostics, like folders/files processed
# }

function Get-FolderAge {

Expand Down Expand Up @@ -208,7 +208,7 @@ function Get-FolderAge {
# TODO: Add verbose here
} else {
# add sub-folders for further processing
$SubFolders = $Children | ? PSIsContainer
$SubFolders = $Children | where {$_.PSIsContainer}
if ($SubFolders) {
$queue += @($SubFolders.FullName)
#Write-Verbose -Message "$(Get-Date -f T) PROCESS.foreach.foreach.while queue length $($queue.Length), last `'$($queue[$queue.Length-1])`'"
Expand All @@ -222,7 +222,7 @@ function Get-FolderAge {
#

Write-Verbose -Message "$(Get-Date -f T) return value for $Folder"
$RetVal = New-Object FolderAgeResult -Property @{
$RetVal = New-Object PSObject -Property @{
Path = $Folder
LastWriteTime = $LastWriteTime
Modified = if ($CutOffTime) {$LastWriteTime -gt $CutOffTime} else {$null} # TODO: Define logic/naming here
Expand Down

0 comments on commit 8674895

Please sign in to comment.