Skip to content

Reorganize module item tree under Settings #1466

@michaellwest

Description

@michaellwest

Summary

Reorganize the /sitecore/system/Modules/PowerShell/ content tree to group items by purpose under a unified Settings node:

PowerShell/
  Settings/
    Access/            Delegated Access, API Keys, Policies
    Resources/         Console Colors, Fonts, Snippets, Remoting Options
    User Settings/     Console, Context, Default, ISE, RemoteAutomation
  Script Library/

Previously, Console Colors, Fonts, Snippets, and Delegated Access were loose nodes at the PowerShell module root. Remoting API Keys, Policies, and Options were nested under Settings/Remoting alongside per-app settings. This made the tree flat and hard to navigate, and mixed reference data with security configuration and user preferences.

Why

  • Clarity - The module root had 6+ unrelated sibling nodes. Grouping by purpose (access control, shared resources, per-user settings) makes the tree self-documenting.
  • Settings/Remoting was doing double duty - It held per-app settings alongside security infrastructure (API Keys, Policies) and lookup data (Audit Levels, Throttle Actions). Remoting had no per-app settings context, so the node was misplaced.
  • Move-proof references - Hardcoded path constants (FontNamesPath, DelegatedItemPath, SettingsItemPath, remoting provider paths) are replaced with GUID-based lookups via Templates.Items. Public string properties are preserved as lazy-loaded values for backward compatibility with external scripts.

Changes

C# code:

  • Templates.Items struct with well-known item GUIDs (Fonts, ConsoleColors, Snippets, DelegatedAccess, ApiKeys, Policies, UserSettings)
  • ApplicationSettings.SettingsItemPath - const string replaced with GUID-based lazy property
  • ApplicationSettings.FontNamesPath - same treatment
  • DelegatedAccessManager.DelegatedItemPath - same treatment
  • RemotingApiKeyProvider and RemotingPolicyManager - path constants removed, use Templates.Items GUIDs directly
  • DelegatedAccessMonitor - StartsWith path check replaced with parent ID comparison (cheaper, move-proof)

Serialization:

  • ~60 YAML files moved to new folder structure with updated Path/Parent fields
  • Spe.Core.module.json rules updated
  • Template field Sources (ForegroundColor, BackgroundColor, FontFamily, AuditLevel, ThrottleAction, Policy) updated
  • Settings/Remoting node removed

Tests, scripts, docs:

  • Integration tests updated to new paths
  • Serialize Changes script updated
  • Create-RemotingPolicyTemplate.ps1 updated
  • Spe.dll-help.maml and remoting-policy-setup.md updated
  • Translation files updated

Migration

A pre-upgrade migration script (Migrate Module Tree) is included in the Script Library under SPE/Core/Platform/Development. Run it BEFORE pushing SCS serialization to move user-created API keys, policies, and delegated access entries to the new parent containers.

Breaking changes

  • Items at old paths will not be found by string-based lookups. User scripts referencing old paths by string need updating.
  • SettingsItemPath, FontNamesPath, DelegatedItemPath are no longer const string - they are static string properties. Code using these as compile-time constants will need recompilation but not source changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions