-
-
Notifications
You must be signed in to change notification settings - Fork 7
Invoke AzureRestMethod
apobekiaris edited this page Sep 4, 2020
·
8 revisions
Invokes Azure DevOps REST API
Invoke-AzureRestMethod [-Resource] <String> [[-Token] <String>] [[-Organization] <String>]
[[-Project] <String>] [[-Version] <String>] [[-Body] <Object>] [[-Method] <WebRequestMethod>]
[<CommonParameters>]
Invokes Azure DevOps REST API
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.
{{ Fill Body Description }}
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ 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
{{ Fill Organization Description }}
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill Project Description }}
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill Resource Description }}
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill Token Description }}
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill Version Description }}
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.