Created
July 13, 2013 23:44
-
-
Save smhinsey/5992613 to your computer and use it in GitHub Desktop.
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
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