AppFabric Cache Management cmdlet

If you start writing your first couple of codes on AppFabric Caching, you’ve probably started to type the same PowerShell commands. If you are a lazy developer, just like me, you get bored to do the same things. So, here is my handy little PowerShell cmdlet, which will help you to prepare your developer environment:

#################################################################
#       AppFabricCacheSetup.ps1 PowerShell Cmdlet               #
#################################################################
# Prepares your AppFabric Cache Cluster environment for         #
# development.                                                  #
#################################################################
# Fatih Boy, March 2010                                         #
# Version 1.0                                                   #
#################################################################

Import-Module DistributedCacheAdministration
Use-CacheCluster
$cacheName= Read-Host "Please enter cache name to create (press enter to use default)"

if($cacheName -ne ""){
    New-Cache $cacheName
}

if ((Get-CacheAllowedClientAccounts).IndexOf($env:username) -eq -1) {
    Grant-CacheAllowedClientAccount $env:username
}

Start-CacheCluster

if($cacheName -ne ""){
    Write-Host ""
    Write-Host "$cacheName cache properties : "
    Write-Host "----------------------------------"

    Get-CacheConfig $cacheName
}else{
    Write-Host ""
    Write-Host "default cache properties : "
    Write-Host "----------------------------------"
    Get-CacheConfig default
}

This little cmdlet will –optionally- create a named cache, allows your user to access cache, starts cache cluster, finally display properties of created cache.

Related posts:

  1. AppFabric Cache Yönetim cmdlet’i
  2. PowerShell ile AppFabric Cache Yönetimi
  3. Connecting to TFS with Different User
  4. CodePlex – Another Open Source project portal from Microsoft
  5. Unattended installation of Visual Studio 2005 Team Explorer
Twitter Digg Delicious Stumbleupon Technorati Facebook Email

One Response to “AppFabric Cache Management cmdlet”

  1. Thanks for your PowerShell cmdlet, as you said it will help me to prepare your developer environment thanks

Leave a Reply