/// <summary>
        /// Execute the create new workflow command
        /// </summary>
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();

            if (this.Definition != null)
            {
                this.Definition = JToken.Parse(this.Definition.ToString());
            }

            if (!string.IsNullOrEmpty(this.DefinitionFilePath))
            {
                this.Definition = CmdletHelper.GetDefinitionFromFile(this.TryResolvePath(this.DefinitionFilePath));
            }

            if (this.Parameters != null)
            {
                this.Parameters = CmdletHelper.ConvertToWorkflowParameterDictionary(this.Parameters);
            }

            if (!string.IsNullOrEmpty(this.ParameterFilePath))
            {
                this.Parameters = CmdletHelper.GetParametersFromFile(this.TryResolvePath(this.ParameterFilePath));
            }

            this.WriteObject(LogicAppClient.CreateWorkflow(this.ResourceGroupName, this.Name, new Workflow
            {
                Location           = this.Location,
                Definition         = this.Definition,
                Parameters         = this.Parameters as Dictionary <string, WorkflowParameter>,
                IntegrationAccount = string.IsNullOrEmpty(this.IntegrationAccountId)
                    ? null
                    : new ResourceReference(this.IntegrationAccountId),
                State = (WorkflowState)Enum.Parse(typeof(WorkflowState), this.State)
            }), true);
        }
        /// <summary>
        /// Execute the create new workflow command
        /// </summary>
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();

            if (this.Definition != null)
            {
                this.Definition = JToken.Parse(this.Definition.ToString());
            }

            if (!string.IsNullOrEmpty(this.DefinitionFilePath))
            {
                this.Definition = CmdletHelper.GetDefinitionFromFile(this.TryResolvePath(this.DefinitionFilePath));
            }

            if (this.Parameters != null)
            {
                this.Parameters = CmdletHelper.ConvertToWorkflowParameterDictionary(this.Parameters);
            }

            if (!string.IsNullOrEmpty(this.ParameterFilePath))
            {
                this.Parameters = CmdletHelper.GetParametersFromFile(this.TryResolvePath(this.ParameterFilePath));
            }

            var servicePlan = WebsitesClient.GetAppServicePlan(this.ResourceGroupName, this.AppServicePlan);

            if (string.IsNullOrEmpty(this.Location))
            {
                this.Location = servicePlan.GeoRegion;
            }

            this.WriteObject(LogicAppClient.CreateWorkflow(this.ResourceGroupName, this.Name, new Workflow
            {
                Location       = this.Location,
                Definition     = this.Definition,
                Parameters     = this.Parameters as Dictionary <string, WorkflowParameter>,
                DefinitionLink = string.IsNullOrEmpty(this.DefinitionLinkUri)
                    ? null
                    : new ContentLink
                {
                    Uri            = this.DefinitionLinkUri,
                    ContentVersion = this.DefinitionLinkContentVersion
                },
                ParametersLink = string.IsNullOrEmpty(this.ParameterLinkUri)
                    ? null
                    : new ContentLink
                {
                    Uri            = this.ParameterLinkUri,
                    ContentVersion = this.ParameterLinkContentVersion
                },
                State = (WorkflowState)Enum.Parse(typeof(WorkflowState), this.State),
                Sku   = new Sku
                {
                    Name = (SkuName)Enum.Parse(typeof(SkuName), servicePlan.Sku.Tier),
                    Plan = new ResourceReference
                    {
                        Id = servicePlan.Id
                    }
                }
            }), true);
        }