Skip to content

Instantly share code, notes, and snippets.

View DanijelMalik's full-sized avatar

Danijel Malik DanijelMalik

  • Sydney, Australia
View GitHub Profile
@DanijelMalik
DanijelMalik / DownloadBuildArtifacts.ps1
Created August 28, 2018 00:44
Download build artifacts in VSTS Release
param(
[Parameter(Mandatory = $true)]
[string] $AccountName
)
# System variables
$projectId = $env:SYSTEM_TEAMPROJECTID
$releaseId = $env:RELEASE_RELEASEID
$artifactsDir = $env:SYSTEM_ARTIFACTSDIRECTORY
$token = $env:SYSTEM_ACCESSTOKEN
param(
[Parameter(Mandatory = $false)]
[string] $Location
)
$oldLocation = Get-Location
Write-Host "Set Git location '$Location" -ForegroundColor Cyan
Set-Location $Location
@DanijelMalik
DanijelMalik / DDD.Sydney.md
Last active June 4, 2017 22:49
DDD Sydney 2017

Get ready for modern DevOps

Modern DevOps is a highway to greater business value and it works cross-platform. Automated deployments solved a handover problem, Application Monitoring Platforms closed the feedback and crash reporting gap, and containers made the “works on my machine” stereotype real. Next mission: automated environments.

In this session, Danijel will start by identifying the common bad practices to give you some quick wins. His experience starts from the smallest businesses and extends to the largest businesses including some of the largest banks. You will learn why Zero Based Infrastructure is the next step of a DevOps evolution, why Cloud is your best friend, and how to integrate this approach back into your deployment pipeline. You will walk away with a solid understanding of what Infrastructure as Code is and the main advantages, leaving you with nothing to worry about but your code.

public TfsHelper(Uri uri, string username, string password)
{
_tfsServer = new TfsTeamProjectCollection(uri, new VssAadCredential(username, password));
_buildServer = _tfsServer.GetService<IBuildServer>();
_versionServer = _tfsServer.GetService<VersionControlServer>();
}
public TfsHelper(Uri uri)
{
_tfsServer = new TfsTeamProjectCollection(uri);
_buildServer = _tfsServer.GetService<IBuildServer>();
_versionServer = _tfsServer.GetService<VersionControlServer>();
}
@DanijelMalik
DanijelMalik / TransformXml.ps1
Created January 6, 2017 03:41
Transforms XML files e.g. Web.Release.config to Web.config
param(
[string] $SourceFile,
[string] $TargetFile
)
if (!$SourceFile -or !(Test-Path -path $SourceFile -PathType Leaf)) {
throw "File not found. $xml";
}
if (!$TargetFile -or !(Test-Path -path $TargetFile -PathType Leaf)) {
throw "File not found. $TargetFile";
}
@DanijelMalik
DanijelMalik / NuGet.config
Created January 6, 2017 03:17
NuGet.config for Sitefinity
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="SitefinityNuGet" value="http://nuget.sitefinity.com/nuget" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
param(
[switch] $Essentials,
[switch] $DevelopmentTools
)
function Install-ChocoPackages()
{
param(
[string[]] $Packages
)