This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clear-Host | |
$buildToCloneName = "Build 1" | |
$newBuildName = "Build 1 - Clone" | |
$user = "[email protected]" | |
$accessToken="4df31252fqt...PAT...." | |
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$accessToken))) | |
$env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI = "https://mycompany.visualstudio.com/" | |
$env:SYSTEM_TEAMPROJECTID = "MyProject" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clear-Host | |
$folderToEmptyBins = "C:\Temp\ATest" | |
#short way | |
cd $folderToEmptyBins | |
get-childitem -Include "bin" -Recurse -force | Remove-Item -Force –Recurse | |
get-childitem -Include "obj" -Recurse -force | Remove-Item -Force –Recurse | |
#long way | |
#function DeleteSubFoldersWithName($folder, $name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to create a nested variable in powershell | |
Clear-Host | |
$NestedObject1 = [pscustomobject]@{Item1="Bob";Item2="Fred";Item3="Joe"} | |
$ParentObject = [pscustomobject]@{LevelA=[pscustomobject]@{LevelB=@($NestedObject1)}} | |
#let's check it | |
$parentObject.LevelA.LevelB[0].Item2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-PSSnapin Microsoft.TeamFoundation.PowerShell | |
#Add-Type -Path "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.Client.dll" | |
# *VSTS Load Above* Load the TFS powershell | |
# NOTE: Must allow build to access tokens in the options | |
Clear-Host | |
$buildToStart = "My-Build-Name e.g. Test - CLI" | |
$newLine = [System.Environment]::NewLine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-PSSnapin Microsoft.TeamFoundation.PowerShell | |
# This file requires the TFS Power Tools (2015+). When installing, you must select Custom Installation and select PowerShell Cmdlets | |
# *VSTS Login* | |
# YOU MUST go to 'Options' and turn on 'Allow scripts to access OAuth token' for the buld | |
$url = "$($env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)$env:SYSTEM_TEAMPROJECTID/_apis/build/definitions/$($env:SYSTEM_DEFINITIONID)?api-version=2.0" | |
Write-Host "URL: $url" | |
$definition = Invoke-RestMethod -Uri $url -Headers @{ | |
Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Calling client | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string answer = ""; | |
//string baseUrl = "http://localhost:56539/"; | |
string baseUrl = "http://169.254.80.80/winauth/"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title></title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/> | |
<link rel="stylesheet" href=""/> | |
<!-- http://qnimate.com/javascript-scroll-by-dragging/ --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>IP Address</title> | |
<meta name="description" content="The HTML5 Herald"> | |
<meta name="author" content="SitePoint"> | |
<link rel="stylesheet" href="css/styles.css?v=1.0"> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This might need tweaking for uppercase/lowercase comparisons | |
// Source - Javscript: The Good Parts, by Douglas Crockford | |
var by = function (name, minor) { | |
// Array sorting | |
// myArray.sort(by('FirstName', by('LastName'))); | |
return function (o, p) { | |
var a, b; | |
if (typeof o === 'object' && typeof p === 'object' && o && p) { | |
a = o[name]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The seekbars min value cannot be changed in the sdk. It has to be zero | |
* Total = 240seconds represented | |
* Start Value = 30 seconds | |
* Each interval of the seekbar = 5 seconds. | |
* <SeekBar | |
android:id="@+id/settings_seekbar_time_interval" | |
android:layout_span="2" | |
android:minWidth="200dp" | |
android:max="42" |