lock improvement

This commit is contained in:
Lanta 2023-11-22 08:49:35 +01:00
parent be3fc54268
commit f545187cfb
5 changed files with 14 additions and 19 deletions

View file

@ -22,7 +22,8 @@ function new-lock {
}
else {
try {
New-Item -ItemType File -Path $lockFile | Out-Null
$content = if ($by) { $by } else { "" }
New-Item -ItemType File -Path $lockFile -Value $content
$lock = $false
}
catch {
@ -36,10 +37,6 @@ function new-lock {
}
$i++
}
if ($by) {
$by | Out-File -FilePath $lockFile -Append
}
}
function remove-lock {
Write-Output 'Removing lock'