Skip to content

Invoke AzureRestMethod

apobekiaris edited this page Sep 4, 2020 · 8 revisions

external help file: XpandPwsh-help.xml Module Name: XpandPwsh online version: schema: 2.0.0

Invoke-AzureRestMethod

SYNOPSIS

Invokes Azure DevOps REST API

SYNTAX

Invoke-AzureRestMethod [-Resource] <String> [[-Token] <String>] [[-Organization] <String>]
 [[-Project] <String>] [[-Version] <String>] [[-Body] <Object>] [[-Method] <WebRequestMethod>]
 [<CommonParameters>]

DESCRIPTION

Invokes Azure DevOps REST API

EXAMPLES

Example 1

PS C:\> $testRunName="TestRun_$BuildName`_$BuildNumber"
"TestRunName=$testRunName"
$testRun=Invoke-AzureRestMethod $Token eXpandDevOps eXpandFramework test/runs|Where-Object{$_.name -eq $testRunName}
if ($testRun.unanalyzedTests){
    throw "$($testRun.unanalyzedTests) test fail"
}

The above script checks the eXpandFramework TestRuns for failing test and fails the build if found. By default the build does not fail.

PARAMETERS

-Body

{{ Fill Body Description }}

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Method

{{ Fill Method Description }}

Type: WebRequestMethod
Parameter Sets: (All)
Aliases:
Accepted values: Default, Get, Head, Post, Put, Delete, Trace, Options, Merge, Patch

Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Organization

{{ Fill Organization Description }}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Project

{{ Fill Project Description }}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Resource

{{ Fill Resource Description }}

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Token

{{ Fill Token Description }}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Version

{{ Fill Version Description }}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Object

NOTES

RELATED LINKS

image

image


Star the project if you think it deserves it.

GitHub stars

Fork the project to extend and contribute.

GitHub forks

Clone this wiki locally