Microsoft.WindowsAzure.Commands.CloudService.Development.Scaffolding.NewAzureRoleTemplateCommand.ExecuteCmdlet C# (CSharp) Method

ExecuteCmdlet() private method

private ExecuteCmdlet ( ) : void
return void
        public override void ExecuteCmdlet()
        {
            string output = !string.IsNullOrEmpty(Output) ? this.TryResolvePath(Output) :
                Web.IsPresent ?
                Path.Combine(CurrentPath(), DefaultWebRoleTemplate) :
                Path.Combine(CurrentPath(), DefaultWorkerRoleTemplate);
            string source = Web.IsPresent ? Path.Combine(Resources.GeneralScaffolding, Resources.WebRole) : Path.Combine(Resources.GeneralScaffolding, Resources.WorkerRole);

            FileUtilities.DirectoryCopy(FileUtilities.GetContentFilePath(source), output, true);

            SafeWriteOutputPSObject(null, Parameters.Path, output);
        }
    }

Usage Example

        public void NewAzureRoleTemplateWithWorkerRole()
        {
            string outputPath = Path.Combine(Directory.GetCurrentDirectory(), "WorkerRoleTemplate");
            addTemplateCmdlet = new NewAzureRoleTemplateCommand() { Worker = true, CommandRuntime = mockCommandRuntime };

            addTemplateCmdlet.ExecuteCmdlet();

            Assert.Equal<string>(outputPath, ((PSObject)mockCommandRuntime.OutputPipeline[0]).GetVariableValue<string>(Parameters.Path));
            Testing.AssertDirectoryIdentical(Path.Combine(Resources.GeneralScaffolding, RoleType.WorkerRole.ToString()), outputPath);
        }
All Usage Examples Of Microsoft.WindowsAzure.Commands.CloudService.Development.Scaffolding.NewAzureRoleTemplateCommand::ExecuteCmdlet
NewAzureRoleTemplateCommand