private PsDeploymentScript TypeCastDeploymentScript(DeploymentScript deploymentScript) { switch (deploymentScript) { case AzurePowerShellScript azurePowerShellScript: return PsAzurePowerShellScript.ToPsAzurePowerShellScript(azurePowerShellScript); case AzureCliScript azureCliScript: return PsAzureCliScript.ToPsAzureCliScript(azureCliScript); default: throw new NotSupportedException(Properties.Resources.DeploymentScriptKindNotSupported); } }
public PsDeploymentScript GetDeploymentScript(string scriptName, string resourceGroupName) { var deploymentScript = DeploymentScriptsClient.DeploymentScripts.Get(resourceGroupName, scriptName); PsDeploymentScript psDeploymentScriptObject; switch (deploymentScript) { case AzurePowerShellScript azurePowerShellScript: psDeploymentScriptObject = PsAzurePowerShellScript.ToPsAzurePowerShellScript(azurePowerShellScript); break; case AzureCliScript azureCliScript: psDeploymentScriptObject = PsAzureCliScript.ToPsAzureCliScript(azureCliScript); break; default: throw new NotSupportedException(Properties.Resources.DeploymentScriptKindNotSupported); } return psDeploymentScriptObject; }