Edit outlook.com contacts in android

Updated 2017-01-17: Updated the blogpost to the new outlook.com experience (on the office 365 platform).

Edit outlook.com contacts in android is a real pain. But in this post I will explain to you have to fix this.

Because Google and Microsoft are in some kind of war in what the best way is to edit contacts, you could be having troubling with editing your Outlook.com contacts in Android. Follow these steps to edit your Outlook.com contacts again.

  1. If you have installed the Outlook.com application out of the play store, remove it from your device. It has been replaced by the new Outlook application some time ago.
  2. Setup the new Outlook application and disable contact sync. Contacts do get synced to your device very nice but you can’t edit them. So they are useless to use. We disable the sync so we can sync them another way. If you leave this enabled you will end up with dupplicates on your phone.
  3. On your phone, go to Settings -> Accounts & Sync
  4. Add an Exchange ActiveSync account. Do not use the outlook.com account. some phones will display an outlook.com sync possibility but that is an old obsolete one. If you can’t find an Exchange account, try to use the default email application on your phone. It should have one build in.
    1. Account name: whatever you want
    2. email adres: your outlook.com email adres (could also be hotmail, msn, live etc)
    3. Server adres: eas.outlook.com
    4. username: again your full email-address
    5. password: your outlook.com email-address password
    6. Enable SSL
    7. Leave the rest default
  5. Click next and select only to sync the Contacts.
  6. Finish the setup (wait a while to finish the syncing of your contacts). Now you can edit your contacts and they are synced to your outlook.com account.

Download files from TFS server with PowerShell

If you want to download files from TFS with PowerShell, you will need to write a script that can access the TFS Server and access the folder on your drive.

This script uses a server path in the TFS server and download some files under that server path to the drop folder of your build. If you don’t use a build, you can change then environment variables. This script is created because of an original question on StackOverflow.

# The deploy directory for all the msi, zip etc.
$AutoDeployDir = "Your TFS Directory Server Path"
$deployDirectory = $($Env:TF_BUILD_DROPLOCATION + "\Deploy\" + $Env:TF_BUILD_BUILDNUMBER)

# Add TFS 2013 dlls so we can download some files
Add-Type -AssemblyName 'Microsoft.TeamFoundation.Client, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Add-Type -AssemblyName 'Microsoft.TeamFoundation.VersionControl.Client, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
$tfsCollectionUrl = 'http://YourServer:8080/tfs/YourCollection' 
$tfsCollection = New-Object -TypeName Microsoft.TeamFoundation.Client.TfsTeamProjectCollection -ArgumentList $tfsCollectionUrl
$tfsVersionControl = $tfsCollection.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer])

# Register PowerShell commands
Add-PSSnapin Microsoft.TeamFoundation.PowerShell

# Get all directories and files in the AutoDeploy directory
$items = Get-TfsChildItem $AutoDeployDir -Recurse

# Download each item to a specific destination
foreach ($item in $items) {
    # Serverpath of the item
    Write-Host "TFS item to download:" $($item.ServerItem) -ForegroundColor Blue

    $destinationPath = $item.ServerItem.Replace($AutoDeployDir, $deployDirectory)
    Write-Host "Download to" $([IO.Path]::GetFullPath($destinationPath)) -ForegroundColor Blue

    if ($item.ItemType -eq "Folder") {
        New-Item $([IO.Path]::GetFullPath($destinationPath)) -ItemType Directory -Force
    }
    else {
        # Download the file (not folder) to destination directory
        $tfsVersionControl.DownloadFile($item.ServerItem, $([IO.Path]::GetFullPath($destinationPath)))
    }
}

 

TFS Power tools 2013 update 2 are released

The TFS Power tools 2013 update 2 are released a few days ago. Strange that there isn’t any notification in your Visual Studio 2013 environment. This update gives you better support for the new features in TFS 2013 Update 2.

You first have to uninstall the old version before installing the new version. If you want PowerShell support, you have to choose the custom installer in the wizard.

Download

You can download the update in the Visual Studio gallery by following this link:
http://visualstudiogallery.msdn.microsoft.com/f017b10c-02b4-4d6d-9845-58a06545627f

TFS delete build definition timeout

When you do a tfs delete on a build definition and you receive a timeout, you probably have to many builds in your TFS server. Even if you delete all the build for your build definition, tfs still stores all the builds in your TFS Server. Just like your TFS Team projects, you have to delete and then destroy the builds. After that, you could delete the build definition completely.

The only way to do this is, is to delete and destroy the builds in pieces. You can only do that by the command prompt.

I created a PowerShell script that loops through the builds for a specific build definition and deletes all the builds before a specific date. So if your build is maybe a year old, you could start the script a year back from now and loop through all the builds until let’s say two months ago. You could skip the number of days you want. I set the days to skip to 15 because I have a lot of builds each month and otherwise the TFS server has trouble to delete the bigger chunks.

$TfsCollectionUrl = "http://YourTfsServer:8080/tfs/YourTeamCollection"
$teamProject = "YourTeamProject"
$BuildDefinition = "YourTeamBuildDefinitionName"

Function CountForward {
    Param([datetime]$startDate,[int]$daysToSkip,[datetime]$endDate)

    Write-Host "Count forward from:" $startDate.ToString("yyyy-MM-dd") -foregroundcolor "magenta"
    Write-Host "Count forward until:" $endDate.ToString("yyyy-MM-dd")-foregroundcolor "magenta"
    Write-Host "Count every" $daysToSkip "day(s)" -foregroundcolor "magenta"

    while ($startDate -le $endDate) {
        $BuildDefinitionFull = $teamProject + "\" + $BuildDefinition
        $dateToQuery = $startDate.ToString("yyyy-MM-dd")

        Write-Host "Delete and destroy Builds before" $startDate.ToString("yyyy-MM-dd") "for build definition" $BuildDefinitionFull -foregroundcolor "magenta"
        
        tfsbuild.exe delete /server:$TfsCollectionUrl /builddefinition:"$BuildDefinitionFull" /daterange:~$dateToQuery /deleteoptions:All /noprompt /silent
        tfsbuild.exe destroy /server:$TfsCollectionUrl /builddefinition:"$BuildDefinitionFull" /daterange:~$dateToQuery /noprompt /silent
        
        $startDate = $startDate.AddDays($daysToSkip)
    }
}
CountForward -startDate (get-Date).AddDays(-300) -daysToSkip 15 -endDate (get-Date).AddDays(-60)

Save the PowerShell file as “DeleteBuildDefinition.ps1” and execute it in your Visual Studio command prompt. You can execute the PowerShell file in your VS command prompt with the following command:

PowerShell -Command "& {D:\DeleteBuildDefinition.ps1}"

tfs delete build definition timeout

Looping in PowerShell forward and backwards through days

I was searching for a way for looping in PowerShell forward and backwards through days every 15 days. So I thought I would share it with you guys.

I have two different samples. Both samples have the option to specify the number of the days to skip in each loop.

The first one is counting back in days until a specific day and the second is counting forward.

Countback

Function CountBack {
    Param([datetime]$startDate,[int]$daysToSkip,[datetime]$endDate)

    Write-Host "Count back from:" $startDate.ToString("yyyy-MM-dd")    
    Write-Host "Count back until:" $endDate.ToString("yyyy-MM-dd")
    Write-Host "Count every" $daysToSkip "day(s)"

    while ($startDate -ge $endDate) {
        Write-Host $startDate.ToString("yyyy-MM-dd")

        # Execute your code here
        
        $startDate = $startDate.AddDays(-$daysToSkip)
    }
}

Execute the command with:

CountBack -startDate (get-Date).AddDays(-12) -daysToSkip 15 -endDate (get-Date).AddDays(-100)

Countforward

Function CountForward {
    Param([datetime]$startDate,[int]$daysToSkip,[datetime]$endDate)

    Write-Host "Count forward from:" $startDate.ToString("yyyy-MM-dd")    
    Write-Host "Count forward until:" $endDate.ToString("yyyy-MM-dd")
    Write-Host "Count every" $daysToSkip "day(s)"

    while ($startDate -le $endDate) {
        Write-Host $startDate.ToString("yyyy-MM-dd")

        # Execute your code here
        
        $startDate = $startDate.AddDays($daysToSkip)
    }
}

Execute the command with:

CountForward -startDate (get-Date).AddDays(-300) -daysToSkip 15 -endDate (get-Date).AddDays(-40)