ps/Modules/Alkami.PowerShell.Common/Public/Backup-AlkamiLogs.ps1
2023-05-30 22:51:22 -07:00

29 lines
750 B
PowerShell

function Backup-AlkamiLogs {
<#
.SYNOPSIS
Archives logs based off a cutoff date and then cleans the .NET temporary files
#>
[CmdletBinding()]
Param(
[Parameter(Mandatory=$false)]
[Alias("LogPath")]
[string]$logDirectory,
[Parameter(Mandatory=$false)]
[Alias("CutoffThreshold")]
[int]$cutoffDays = 1,
[Parameter(Mandatory=$false)]
[Alias("SkipActive")]
[switch]$skipActiveLogs
)
if ([string]::IsNullOrEmpty($logDirectory)) {
$logDirectory = (Get-OrbLogsPath)
}
Backup-ORBLogFiles -skipActiveLogs:$skipActiveLogs.IsPresent;
Remove-OldArchivedLogFiles -ArchivePath (Join-Path $logDirectory "Archive") -CutoffThreshold $cutoffDays;
}