Skip to content

Instantly share code, notes, and snippets.

View IlyaFinkelshteyn's full-sized avatar

Ilya Finkelshteyn IlyaFinkelshteyn

  • Azure App Service
  • Seattle WA
View GitHub Profile
$token = '<API_Token>'
$headers = @{
"Authorization" = "Bearer $token"
"Content-type" = "application/json"
}
$body = @{
accountName="<Your_account>"
projectSlug="<Your_project_slug>"
@IlyaFinkelshteyn
IlyaFinkelshteyn / InstallVs2010_Shell.ps1
Last active March 2, 2021 10:31
Install Microsoft Visual Studio 2010 Shell (Isolated) Redistributable Package
if ((Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object {$_.DisplayName -eq "Microsoft Visual Studio 2010 Shell (Isolated) - ENU"}) -ne $null)
{
Write-Host "Microsoft Visual Studio 2010 Shell (Isolated) Redistributable Package already installed."
}
else
{
Measure-command {
Write-Host "Downloading Microsoft Visual Studio 2010 Shell (Isolated) Redistributable Package..."
$exePath = "$($env:USERPROFILE)\VSIsoShell.exe"
(New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/1/9/3/1939AD78-F8E8-4336-83F3-E2470F422C62/VSIsoShell.exe', $exePath)
$token = '<API_TOKEN>'
$sourceEnvironmentName = '<SOURCE_ENVIRONMENT_NAME>'
$headers = @{
"Authorization" = "Bearer $token"
"Content-type" = "application/json"
}
# get source environment ID
$sourceEnvironmentId = ((Invoke-RestMethod -Uri "https://ci.appveyor.com/api/environments" -Headers $headers -Method Get) | where {$_.name -eq $sourceEnvironmentName}).deploymentEnvironmentId
# Job 'Environment: test=1' uploads artifact. Others wait while it finishes and download it.
clone_script:
- cmd: echo skip clone
environment:
ApiKey:
secure: SlDEDtAKuvsy+VErEuc/4DxdhPeKu2WRqvYzEh/fiH4=
TimeOutMins: 2
jobToWait: 'Environment: test=1'
matrix:
- test: 1
# Preparation steps:
# On local machine (or you can use https://www.appveyor.com/docs/how-to/rdp-to-build-worker/ instead):
# Install https://pub.storage.googleapis.com/gsutil.zip
# Run gsutil config and complete authentication and configuration
# Check that "$env:USERPROFILE\.boto" created
# Optionally cleanup "$env:USERPROFILE\.boto" (remove comments) and add some additional configuration if needed
# Encode .boto file as a Base64 string (PowerShell sample):
# $bytes = [System.IO.File]::ReadAllBytes("$env:USERPROFILE\.boto")
# [System.Convert]::ToBase64String($bytes)
# Encrypt result with https://ci.appveyor.com/tools/encrypt
$token = '<API_TOKEN>' # account-level API token
$headers = @{
"Authorization" = "Bearer $token"
"Content-type" = "application/json"
}
# create new project
$body = @{
repositoryProvider="gitHub"
repositoryName="<githib_user_name>/<github_repo_name>"
install:
- cmd: choco install resharper-clt
after_build:
- cmd: InspectCode.exe -o=resharper-clt-output.xml src\ProjectA.sln
- ps: $result = [xml](Get-Content .\resharper-clt-output.xml)
- ps: $result.Report.Issues.ChildNodes | ForEach-Object {$project = $_.Name; $_.ChildNodes | ForEach-Object {Add-AppveyorCompilationMessage -Message $_.Message -Line $_.Line -FileName $_.File -ProjectName $project}}
$token = "<clear_text_api_token>"
$Channel = "<channel>"
$Message = "test from ps"
$body = @{
token = $token
channel = $Channel
text = $Message
}
if ($env:APPVEYOR_JOB_NUMBER -ne 1) {return}
write-host "Waiting for other jobs to complete"
$headers = @{
"Authorization" = "Bearer $ApiKey"
"Content-type" = "application/json"
}
[datetime]$stop = ([datetime]::Now).AddMinutes($env:TimeOutMins)
$env:API_TOKEN="<replace>" # https://ci.appveyor.com/api-keys
$env:APPVEYOR_ACCOUNT_NAME="<replace>" # from AppVeyor URL (after "project/")
$env:APPVEYOR_PROJECT_SLUG="<replace>" # from AppVeyor URL (after account name)
$env:recordsNumber = 20
$headers = @{
"Authorization" = "Bearer $env:API_TOKEN"
"Content-type" = "application/json"
}