Skip to content

Feature Request: PowerShell Profile Support #8

Description

@grave0x

Summary

Add support for managing PowerShell profiles (both Windows PowerShell Profile.ps1 and PowerShell Core Microsoft.PowerShell_profile.ps1) as first-class dwell entries.

Motivation

PowerShell is the primary shell on Windows and widely used cross-platform. Users need to manage their PowerShell profile scripts alongside bash, zsh, fish, and other dotfiles.

Proposed behavior

  • dwell add $PROFILE should detect PowerShell profiles and copy them into the source directory with the appropriate prefix (e.g. dot_powershell/Microsoft.PowerShell_profile.ps1).
  • Template rendering should work on .ps1.tmpl files.
  • source_to_target() should correctly resolve PowerShell profile paths across Windows (%USERPROFILE%\Documents\PowerShell) and non-Windows (~/.config/powershell/).

Implementation notes

  • $PROFILE on Windows points to %USERPROFILE%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
  • Cross-platform PowerShell Core uses ~/.config/powershell/Microsoft.PowerShell_profile.ps1
  • The existing EntryKind::from_filename() could handle dot_powershell/ prefixed files
  • The source_to_target() function in dwell-core/src/types.rs would need a new PowerShell mapping
  • No existing tests cover PowerShell paths

Acceptance criteria

  • dwell add $PROFILE works on Windows
  • dwell add ~/.config/powershell/Microsoft.PowerShell_profile.ps1 works on Linux/macOS
  • source_to_target() maps dot_powershell/profile.ps1 to the correct target path
  • Template files with .ps1.tmpl extension render correctly
  • Integration tests added for PowerShell paths

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions