Skip to content

Commit a377867

Browse files
Make LogIfFileIsBlocked safe (#175)
1 parent 7a0a53e commit a377867

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/Outsystems.SetupTools/Lib/Common.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,15 @@ function CheckIfFileIsBlocked([string]$Path)
391391

392392
function LogIfFileIsBlocked([string]$Function, [string]$Path)
393393
{
394-
if ($(CheckIfFileIsBlocked -Path $Path))
394+
try
395395
{
396+
if ($(CheckIfFileIsBlocked -Path $Path))
397+
{
396398
LogMessage -Function $Function -Phase 1 -Stream 1 -Message "$($Path) might be blocked (ZoneId <> 0). Depending on the windows policies of the machine the installation might get stuck."
399+
}
400+
}
401+
catch
402+
{
403+
LogMessage -Function $Function -Phase 1 -Stream 2 -Message "Unable to open check if file is blocked $($_.Exception)"
397404
}
398405
}

0 commit comments

Comments
 (0)