Example #1
0
 public override void ExecuteCmdlet()
 {
     if (ShouldProcess(Utils.GetDefinitionLocationId(Blueprint.Scope), string.Format(Resources.PublishBlueprintShouldProcessString, Blueprint.Name)))
     {
         try
         {
             WriteObject(BlueprintClient.CreatePublishedBlueprint(Blueprint.Scope, Blueprint.Name, Version));
         }
         catch (Exception ex)
         {
             WriteExceptionError(ex);
         }
     }
 }
Example #2
0
        public override void ExecuteCmdlet()
        {
            if (ShouldProcess(Utils.GetDefinitionLocationId(Blueprint.Scope), string.Format(Resources.PublishBlueprintShouldProcessString, Blueprint.Name)))
            {
                try
                {
                    // parameters property is placeholder here, backend strips this information and publishes the latest master. It is needed in the payload since swagger calls it required.
                    var publishedBlueprintObjForChangeNotes = new PublishedBlueprint(
                        parameters: new Dictionary <string, ParameterDefinition>(), changeNotes: ChangeNote);

                    WriteObject(BlueprintClient.CreatePublishedBlueprint(Blueprint.Scope, Blueprint.Name, Version, publishedBlueprintObjForChangeNotes));
                }
                catch (Exception ex)
                {
                    WriteExceptionError(ex);
                }
            }
        }