| 
									
										
										
										
											2019-08-06 15:28:45 +08:00
										 |  |  | 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." | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-09 09:18:19 +08:00
										 |  |  |     return Invoke-RestMethod -Method GET -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/build/$env:APPVEYOR_BUILD_VERSION" -Headers @{ | 
					
						
							| 
									
										
										
										
											2019-08-06 15:28:45 +08:00
										 |  |  |         "Authorization" = "Bearer $env:APPVEYOR_API_TOKEN" | 
					
						
							|  |  |  |         "Content-type"  = "application/json" | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |