Skip to content

Instantly share code, notes, and snippets.

@smhinsey
Created July 13, 2013 23:44
Show Gist options
  • Save smhinsey/5992613 to your computer and use it in GitHub Desktop.
Save smhinsey/5992613 to your computer and use it in GitHub Desktop.
function undeploy
{
Param(
[parameter(Mandatory=$true, Position=0)]
[ValidateSet("Production","Staging")]
[String]
$deploymentSlot,
[parameter(Mandatory=$true, Position=1)]
[String]
$serviceName,
[parameter(Mandatory=$true, Position=2)]
#[ValidateScript({Test-Path $_})]
[String]
$pathToCertificate,
[parameter(Mandatory=$true, Position=3)]
[Guid]
$subscriptionId
)
Process
{
$certificate = Get-Item $pathToCertificate
Write-Host "Undeploying " $serviceName "(" $deploymentSlot ")"
Get-HostedService $serviceName -Certificate $certificate -SubscriptionId $subscriptionId |
Get-Deployment -Slot $deploymentSlot |
Remove-Deployment |
Get-OperationStatus -WaitToComplete
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment