/// <summary>
/// The code to run if setting azure instances
/// </summary>
/// <param name="roleName">The name of the role to update</param>
/// <param name="instances">The new number of instances for the role</param>
/// <param name="rootPath">The root path to the service containing the role</param>
/// <returns>Role after updating instance count</returns>
public RoleSettings SetAzureInstancesProcess(string roleName, int instances, string rootPath)
{
CloudServiceProject service = new CloudServiceProject(rootPath, null);
service.SetRoleInstances(service.Paths, roleName, instances);
if (PassThru)
{
SafeWriteOutputPSObject(typeof(RoleSettings).FullName, Parameters.RoleName, roleName);
}
return service.Components.GetCloudConfigRole(roleName);
}