forked from timmcmic/DLConversionV2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Start-ArchiveFiles.ps1
61 lines (42 loc) · 1.55 KB
/
Start-ArchiveFiles.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
56
57
58
59
60
61
<#
.SYNOPSIS
This function archives the files associated with the distribution list migration.
.DESCRIPTION
his function archives the files associated with the distribution list migration.
.PARAMETER isSuccess
.OUTPUTS
No return.
.EXAMPLE
start-archiveFiles -isSuccess:$TRUE
#>
Function Start-ArchiveFiles
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory = $true)]
[boolean]$isSuccess=$FALSE,
[Parameter(Mandatory = $true)]
[string]$logFolderPath=$NULL
)
out-logFile -string "Archiving files associated with run."
$functionDate = Get-Date -Format FileDateTime
if ($isSuccess -eq $TRUE)
{
out-logfile -string "Success - renaming directory."
$functionFolderName = $functionDate+"-Success"
$functionOriginalPath= $logFolderPath+$global:staticFolderName
out-logfile -string $functionFolderName
out-logfile -string $functionOriginalPath
rename-item -path $functionOriginalPath -newName $functionFolderName
}
else
{
out-logfile -string "FAILED - renaming directory."
$functionFolderName = $functionDate+"-FAILED"
$functionOriginalPath= $logFolderPath+$global:staticFolderName
out-logfile -string $functionFolderName
out-logfile -string $functionOriginalPath
rename-item -path $functionOriginalPath -newName $functionFolderName
}
}