Skip to content

Commit 2a387ff

Browse files
committed
Also try to get git user name and call ConvertTo-Json
1 parent 28e6fe7 commit 2a387ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ElmahIoDeploymentNotification/notify.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ if ($Env:RELEASE_RELEASENAME) {
2323
if (-not $userEmail) {
2424
$userEmail = $(git log -1 --pretty=format:'%ae')
2525
}
26+
if (-not $userName) {
27+
$userName = $(git log -1 --pretty=format:'%an')
28+
}
2629
}
2730

2831
$ProgressPreference = "SilentlyContinue"
@@ -38,7 +41,7 @@ $body = @{
3841
"logId" = $logId
3942
}
4043
Try {
41-
Invoke-RestMethod -Method Post -Uri $url -Body $body
44+
Invoke-RestMethod -Method Post -Uri $url -Body ($body | ConvertTo-Json)
4245
}
4346
Catch {
4447
Write-Error $_.Exception.Message -ErrorAction Continue

0 commit comments

Comments
 (0)