Parameterize Service Fabric Node Bootstrap service name in PatchIssuerThumbprints.ps1#317
Draft
Parameterize Service Fabric Node Bootstrap service name in PatchIssuerThumbprints.ps1#317
Conversation
…rThumbprints.ps1 Co-authored-by: LukeSlev <28886212+LukeSlev@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Parameterize bootstrap service name in PatchIssuerThumbprints script
Parameterize Service Fabric Node Bootstrap service name in PatchIssuerThumbprints.ps1
Aug 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhanced the
PatchIssuerThumbprints.ps1script to support customizable Service Fabric Node Bootstrap Agent service names, addressing environments where the service is registered under a different name than the defaultServiceFabricNodeBootstrapAgent.Problem
The existing script had the Service Fabric Node Bootstrap Agent service name hard-coded as
"ServiceFabricNodeBootstrapAgent"throughout theStopServiceFabricServicesandStartServiceFabricServiceshelper functions. This prevented the script from working in environments with:Changes Made
1. New Parameter
Added a new top-level script parameter with backward-compatible default:
2. Updated Documentation
Added comprehensive parameter documentation in the comment-based help:
.PARAMETER bootstrapAgentServiceName (New) The Windows service name of the Service Fabric Node Bootstrap Agent. Default: ServiceFabricNodeBootstrapAgent Override this if your environment uses a different service name.3. Function Refactoring
Modified both service management functions to accept a mandatory parameter:
StopServiceFabricServices -BootstrapServiceName $bootstrapAgentServiceNameStartServiceFabricServices -BootstrapServiceName $bootstrapAgentServiceName4. Defensive Error Handling
Added
-ErrorAction SilentlyContinueto allGet-Servicecalls to gracefully handle scenarios where:5. Remote Execution Support
Updated all
Invoke-Commandcalls to include the new parameter in their argument lists, ensuring the custom service name is properly passed to remote nodes.Usage Examples
Original usage (backward compatible):
With custom bootstrap service name:
Remote execution with custom service:
Benefits
Testing
All changes have been validated for:
The script maintains full backward compatibility while enabling new customization scenarios.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.