Merge pull request #54 from OpzekerIT/dev

Lockfile for discord ps1
This commit is contained in:
Lanta 2023-09-30 10:28:18 +02:00 committed by GitHub
commit 8917f52c69
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,6 @@
. .\..\includes\ps1\lockfile.ps1
new-lock
if ($PSScriptRoot.length -eq 0) { if ($PSScriptRoot.length -eq 0) {
$scriptroot = Get-Location $scriptroot = Get-Location
@ -151,3 +154,5 @@ $newJson = $player_matches | ConvertTo-Json -Depth 100
# Display the updated JSON # Display the updated JSON
$newJson | out-file "$scriptroot/../data/player_matches.json" $newJson | out-file "$scriptroot/../data/player_matches.json"
remove-lock

View file

@ -1,4 +1,7 @@
. .\..\includes\ps1\lockfile.ps1
new-lock
if ($PSScriptRoot.length -eq 0) { if ($PSScriptRoot.length -eq 0) {
$scriptroot = Get-Location $scriptroot = Get-Location
@ -99,3 +102,4 @@ $payload = [PSCustomObject]@{
} }
Invoke-RestMethod -Uri $webhookurl -Method Post -Body ($payload | ConvertTo-Json) -ContentType 'Application/Json' Invoke-RestMethod -Uri $webhookurl -Method Post -Body ($payload | ConvertTo-Json) -ContentType 'Application/Json'
remove-lock