Skip to content

Commit

Permalink
Improve output object
Browse files Browse the repository at this point in the history
  • Loading branch information
PrzemyslawKlys committed Feb 3, 2024
1 parent 2444e19 commit bffc4f2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Private/Get-PrivateFTPFiles.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,22 @@
$Message = $Client.DownloadFiles($LocalPath, ([string[]] $FileToDownload), $LocalExists, $VerifyOptions, $FtpError)
} catch {
$Status = [PSCustomObject] @{
Action = 'DownloadFile'
Status = $false
LocalPath = $LocalPath
RemotePath = $FileToDownload
Message = "Error: $($_.Exception.Message)"
Action = 'DownloadFile'
Status = $false
IsSuccess = $false
IsSkipped = $false
IsSkippedByRule = $false
IsFailed = $true
LocalPath = $LocalPath
RemotePath = $FileToDownload
Message = "Error: $($_.Exception.Message)"
}
$Status
if ($PSBoundParameters.ErrorAction -eq 'Stop') {
Write-Error $_
return
} else {
Write-Warning "Receive-FTPFile - Error: $($_.Exception.Message)"
return $Status
}
}
if (-not $Status) {
Expand Down

0 comments on commit bffc4f2

Please sign in to comment.