Skip to content

Commit 6a73930

Browse files
committed
Fix: Invoke-FilesBackup : Cannot bind argument to parameter 'SlackFile' because it is an empty array.
Stop processing if file cannot be downloaded
1 parent bfa1f58 commit 6a73930

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Slack.Backup/Private/backup/Invoke-FilesBackup.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ function Invoke-FilesBackup {
3434
Write-Progress -Activity "File $($f.id)" -PercentComplete $perc -Status "Downloading"
3535
$slackFile = Get-SlackFile -Token $Token -Uri $f.url_private
3636

37+
if ($slackFile.Length -eq 0) {
38+
Write-Host "File $($f.id) is empty or could not be downloaded."
39+
return
40+
}
41+
3742
Write-Progress -Activity "File $($f.id)" -PercentComplete $perc -Status "Running FileDataProcessingPipeline"
3843
$slackFile = Invoke-FileDataProcessingPipeline -SlackFile $slackFile -Metadata $f
3944
[System.IO.File]::WriteAllBytes("$path.$ext", $slackFile)

Slack.Backup/Slack.Backup.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
@{
33
RootModule = 'Slack.Backup.psm1'
4-
ModuleVersion = '1.1.3'
4+
ModuleVersion = '1.1.4'
55
GUID = '5fca212b-de20-40cb-ba38-e6114263bfaa'
66
Author = 'Alan Plocieniak'
77
CompanyName = 'Alan Plocieniak'

0 commit comments

Comments
 (0)