From 006b768cebe44a029e3a692dcca3c1e644305dc3 Mon Sep 17 00:00:00 2001 From: Igor Iric Date: Tue, 9 Oct 2018 09:30:19 +0200 Subject: [PATCH] PSv2IssuesResolved --- Get-FolderAge.ps1 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Get-FolderAge.ps1 b/Get-FolderAge.ps1 index 750a738..5f3d388 100644 --- a/Get-FolderAge.ps1 +++ b/Get-FolderAge.ps1 @@ -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 { @@ -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])`'" @@ -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