mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
win_slurp - fix glob like paths (#53831)
This commit is contained in:
parent
d063cefb64
commit
d00418c924
5 changed files with 33 additions and 7 deletions
|
@ -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";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue