15 lines
		
	
	
		
			491 B
		
	
	
	
		
			PowerShell
		
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			491 B
		
	
	
	
		
			PowerShell
		
	
	
	
| function Get-AppVeyorBuild {
 | |
|     param()
 | |
| 
 | |
|     if (-not ($env:APPVEYOR_API_TOKEN)) {
 | |
|         throw "missing api token for AppVeyor."
 | |
|     }
 | |
|     if (-not ($env:APPVEYOR_ACCOUNT_NAME)) {
 | |
|         throw "not an appveyor build."
 | |
|     }
 | |
| 
 | |
|     return Invoke-RestMethod -Method GET -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG" -Headers @{
 | |
|         "Authorization" = "Bearer $env:APPVEYOR_API_TOKEN"
 | |
|         "Content-type"  = "application/json"
 | |
|     }
 | |
| } |