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
parent d063cefb64
commit d00418c924
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";
}