-
Notifications
You must be signed in to change notification settings - Fork 10
/
get-StatusFileCount.ps1
55 lines (40 loc) · 1.65 KB
/
get-StatusFileCount.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<#
.SYNOPSIS
This function returns the file count of the status directory.
.DESCRIPTION
This function returns the count of the status file directory.
.OUTPUTS
Count of status directory.
.EXAMPLE
get-StatusFileCount
#>
Function get-statusFileCount
{
out-logfile -string "================================================================================"
out-logfile -string "START Get-StatusFileCount"
out-logfile -string "================================================================================"
[int]$functionFileCount = 0
[array]$childItems=@()
try{
$childItems=get-childitem -path $global:fullStatusPath -file -errorAction STOP
}
catch{
out-logfile -string "Unable to get count of files in status directory." -isError:$TRUE
}
$functionFileCount = $childItems.count
if ($functionFileCount -gt 0)
{
out-logfile -string "The child items found in the status directory."
out-logfile -string $childItems
out-logfile -string "The number of items found in the status directory."
out-logfile -string $functionFileCount
}
else
{
out-logfile -string "No files found in directory."
}
out-logfile -string "================================================================================"
out-logfile -string "END Get-StatusFileCount"
out-logfile -string "================================================================================"
return $functionFileCount
}