mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-22 00:00:22 -07:00
Fix 'touch' mode so it creates zero size files. (#20876)
This commit is contained in:
parent
ed52714dba
commit
2c70450e23
2 changed files with 11 additions and 1 deletions
|
@ -35,7 +35,7 @@ if ($state -eq "touch") {
|
|||
if (Test-Path $path) {
|
||||
(Get-ChildItem $path).LastWriteTime = Get-Date
|
||||
} else {
|
||||
echo $null > $path
|
||||
Write-Output $null | Out-File -FilePath $path -Encoding ASCII
|
||||
}
|
||||
}
|
||||
$result.changed = $true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue