Skip to content

Add bulk find/replace rename for selected policies/apps - #72

Draft
MG-Cloudflow with Copilot wants to merge 5 commits into
mainfrom
copilot/rename-multiple-policy-names
Draft

Add bulk find/replace rename for selected policies/apps#72
MG-Cloudflow with Copilot wants to merge 5 commits into
mainfrom
copilot/rename-multiple-policy-names

Conversation

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Renaming in Intune Toolkit was limited to a single selected item, making common prefix/word updates across multiple policies tedious. This change adds a bulk rename path that applies find/replace across selected policy/app names while preserving existing single-item edit behavior.

  • Bulk rename flow (multi-select)

    • Added a SelectedItems.Count -gt 1 path in Scripts/RenameButton.ps1.
    • Prompts for find and replace text, confirms intent, then applies rename to each selected item.
    • Supports text removal by allowing empty replacement.
    • Uses case-insensitive matching/replacement and reports Renamed / Skipped / Failed totals at completion.
  • Single-item flow remains intact

    • Existing one-item rename + description update flow is unchanged in behavior.
    • Shared policy name field and PATCH endpoint resolution were extracted into small helpers to avoid drift between single and bulk paths.
  • Operational diagnostics

    • Added explicit skip/failure logging for bulk operations, including unavailable-name cases and attempted name transitions.
  • Docs update

    • Updated README feature text to reflect single-item edit plus bulk find/replace rename support.
if ($selectedPolicies.Count -gt 1) {
    $findText = $findTextInput.Trim()
    $newName = [System.Text.RegularExpressions.Regex]::Replace(
        $currentName,
        [System.Text.RegularExpressions.Regex]::Escape($findText),
        [System.Text.RegularExpressions.MatchEvaluator]{ param($match) $replaceText },
        [System.Text.RegularExpressions.RegexOptions]::IgnoreCase
    )
}

Copilot AI linked an issue Jul 25, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add functionality to rename multiple policy names Add bulk find/replace rename for selected policies/apps Jul 25, 2026
Copilot AI requested a review from MG-Cloudflow July 25, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Rename multiple policy names

2 participants