header missing
This commit is contained in:
parent
90be5f9752
commit
540fe66dc7
1 changed files with 17 additions and 1 deletions
|
|
@ -8,6 +8,22 @@ else {
|
|||
|
||||
Start-Transcript "$scriptroot/debug.txt" -Append
|
||||
|
||||
$fileContent = Get-Content -Path "$scriptroot/../config/config.php" -Raw
|
||||
|
||||
# Use regex to match the apiKey value
|
||||
if ($fileContent -match "\`$apiKey\s*=\s*\'([^\']+)\'") {
|
||||
$apiKey = $matches[1]
|
||||
}
|
||||
else {
|
||||
Write-Output "API Key not found"
|
||||
}
|
||||
|
||||
$headers = @{
|
||||
'accept' = 'application/vnd.api+json'
|
||||
'Authorization' = "$apiKey"
|
||||
}
|
||||
|
||||
|
||||
$fileContent = Get-Content -Path "$scriptroot/../discord/config.php" -Raw
|
||||
|
||||
# Use regex to match the apiKey value
|
||||
|
|
@ -15,7 +31,7 @@ if ($fileContent -match "\`$webhookurl\s*=\s*\'([^\']+)\'") {
|
|||
$webhookurl = $matches[1]
|
||||
}
|
||||
else {
|
||||
Write-Output "API Key not found"
|
||||
Write-Output "No web url found"
|
||||
}
|
||||
|
||||
function send-discord {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue