Skip to content
This repository was archived by the owner on Feb 24, 2021. It is now read-only.
This repository was archived by the owner on Feb 24, 2021. It is now read-only.

Remove the workaround code that was added for the missing AppVeyor cmdlet #300

@johlju

Description

@johlju

Details of the problem, bug, or enhancement

It looks like the cmdlet Add-AppveyorTest now should work on PS Core since the issue appveyor/ci#2263 was closed. I have not tested. But if it works, then the following code could be simplified.

if ($PSVersionTable.PSEdition -eq 'Core')
{
$requestObject = @{
testName = $addAppVeyorTestParameters.Name
testFramework = $addAppVeyorTestParameters.Framework
fileName = $addAppVeyorTestParameters.Filename
outcome = $addAppVeyorTestParameters.Outcome
durationMilliseconds = $addAppVeyorTestParameters.Duration
}
if ($result.FailureMessage)
{
$requestObject['ErrorMessage'] = $addAppVeyorTestParameters.ErrorMessage
$requestObject['ErrorStackTrace'] = $addAppVeyorTestParameters.ErrorStackTrace
}
<#
ConvertTo-Json will handle all escaping for us, like escaping
double quotes and backslashes.
#>
$requestBody = $requestObject | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "$env:APPVEYOR_API_URL/api/tests" -Body $requestBody -ContentType 'application/json' | Out-Null
}
else
{
Add-AppveyorTest @addAppVeyorTestParameters
}

Verbose logs showing the problem (if applicable)

n/a

Suggested solution to the issue

Remove the workaround code that was added for the missing AppVeyor cmdlet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue is an enhancement request.help wantedThe issue is up for grabs for anyone in the community.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions