move to the get-new-tool-versions folder

This commit is contained in:
Aleksandr Chebotov
2020-07-03 13:53:05 +03:00
parent 61f1d6c3c7
commit 9a31e4815a
3 changed files with 40 additions and 39 deletions

View File

@@ -70,4 +70,43 @@ function Skip-ExistingVersions {
)
return $VersionsFromDist | Where-Object { $VersionsFromManifest -notcontains $_ }
}
<#
.SYNOPSIS
Sending messages using Incoming Webhooks
https://api.slack.com/messaging/webhooks
#>
function Send-SlackPostMessageIncomingWebHook
{
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[System.Uri]$Uri,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[System.Object]$Body
)
try
{
$response = Invoke-RestMethod -Uri $uri -Method POST -Body $body -ErrorAction Stop
if ($response -eq 'ok')
{
return $response
}
else
{
Write-Host "##vso[task.LogIssue type=error;] Something went wrong. Response is '$response'"
}
}
catch
{
Write-Host "##vso[task.LogIssue type=error;] Slack send post message failed: '$_'"
}
Write-Host "##vso[task.complete result=Failed;]"
exit 1
}