Skip to content

Instantly share code, notes, and snippets.

Marcus Felling MarcusFelling

Block or report user

Report or block MarcusFelling

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View run.ps1
using namespace System.Net
# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)
# Write to the Azure Functions log stream.
"PowerShell HTTP trigger function processed a request."
# Get Personal Access Token (PAT) from query parameter of the request.
$PAT = $Request.Query.PAT
View Update-ReleaseDefinitionsWindowsMachineFileCopyTask.ps1
Script used to bulk update Azure Pipeline release definition's WindowsMachineFileCopy from v1 to v2
.\Update-ReleaseDefinitionsWindowsMachineFileCopyTask.ps1 -PAT "NoTaReAlPaT" -AzureDevOpsProjectURL "{organization}/{project}"
MarcusFelling / example.yml
Created Jan 23, 2019
Audhari Poornimarao YAML example
View example.yml
# Build app using Azure Pipelines
vmImage: 'vs2017-win2016'
– script: echo hello world
– task: NodeTool@0
versionSpec: '8.x'
View Get-ReleasesNotInProduction.ps1
Script used to gather all releases that have been successfully deployed to QA,
but not yet promoted to Prod environments. Outputs release definition name and URL of release to LatestReleases.html
.\Get-ReleasesNotInProduction.ps1 -PAT "NoTaReAlPaT" -AzureDevOpsProjectURL "{organization}/{project}"
View KillDotnetProcesses.ps1
$dotnet = Get-Process dotnet -ErrorAction SilentlyContinue
taskkill.exe /F /IM dotnet.exe
"No dotnet.exe tasks to kill"
View CreateRelease.ps1
Creates a new release for the specified release definition name, using the latest artifact versions available
.Parameter PAT
Personal Access token. It's recommended to use a service account and pass via encrypted build definition variable.
.Parameter ReleaseDefinitionName
Name of release definition to create a release for
-Parameters are outside of functions in order to be passed by TFS build definition variables
View AssemblyInfoVersioning
$VersionRegex = "\d+\.\d+\.\d+\.\d+"
$Files = Get-ChildItem $Env:BUILD_SOURCESDIRECTORY -recurse -include "*Properties*" |
?{ $_.PSIsContainer } |
ForEach { Get-ChildItem -Path $_.FullName -Recurse -include AssemblyInfo.* }
"Will apply $env:Version to $($Files.count) files."
ForEach ($File in $Files) {
$Filecontent = Get-Content($File)
attrib $File -r
$Filecontent -replace $VersionRegex, $env:Version | Out-File $File
MarcusFelling / VSTSAgentInstall.rb
Last active Dec 26, 2017
Chef recipe to install VSTS agents
View VSTSAgentInstall.rb
# Array of agents to create
example_agents = ['Example-1', "Example-2", "Example-3", "Example-4", "Example-5", "Example-6"]
example_agentpool = ''
install_dir = 'H:\\agents\\'
sv_user = '' # Windows log on account for agent service
sv_password = ''
vsts_url = ''
vsts_token = '' # Temporary PAT to use when installing the agents
# Download install files from S3
View ExitStandby.ps1
# Part 2 of 2
# Part 1 Places EC2 instance into autoscaling group's standby mode.
# Part 2 Exits standby mode and waits for instance to be InService.
param (
[Parameter(Mandatory=$true)][string]$ASGEnterStandbyDeployStep, # Deploy step name of EnterStandby.ps1
[Parameter(Mandatory=$true)][string]$ASGNameVariable, # Variable name that is set by EnterStandby.ps1 for ASG Name
View EnterStandby.ps1
# Part 1 of 2
# Part 1 Places EC2 instance into autoscaling group's standby mode.
# Part 2 Exits standby mode and waits for instance to be InService.
param (
[Parameter(Mandatory=$true)][string]$ASGNameVariable # Passed in Octopus script step
# Get EC2 Instance
$response = Invoke-RestMethod -Uri "" -Method Get
You can’t perform that action at this time.