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.

Şu Yazıları da Sevebilirsiniz

1 comment

cargames 11 Mayıs 2010 - 09:07

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

Reply

Leave a Comment

* Bu formu kullanarak, verilerinizin bu web sitesi tarafından saklanması ve kullanılmasını kabul ediyorsunuz.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Bu web sitesi deneyiminizi geliştirmek için çerezleri kullanır. Bunu kabul ettiğinizi varsayacağız, ancak isterseniz vazgeçebilirsiniz. Kabul Et Daha Fazla Bilgi