win_slurp - fix glob like paths (#53831)

This commit is contained in:
Jordan Borean 2019-03-15 14:59:01 +10:00 committed by GitHub
commit d00418c924
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 7 deletions

View file

@ -11,14 +11,14 @@ $result = @{
changed = $false;
}
If (Test-Path -Path $src -PathType Leaf)
If (Test-Path -LiteralPath $src -PathType Leaf)
{
$bytes = [System.IO.File]::ReadAllBytes($src);
$result.content = [System.Convert]::ToBase64String($bytes);
$result.encoding = "base64";
Exit-Json $result;
}
ElseIf (Test-Path -Path $src -PathType Container)
ElseIf (Test-Path -LiteralPath $src -PathType Container)
{
Fail-Json $result "Path $src is a directory";
}