Skip to content

PowerStub v2.3.0

Choose a tag to compare

@devpossible-richard devpossible-richard released this 06 Oct 03:29
· 2 commits to main since this release

PowerStub 2.3.0

  • New Add-PowerStubToProfile command: makes PowerStub load in every new session. It replaces the README's old Add-Content $PROFILE "nImport-Module PowerStub"` step, which failed when the profile folder did not exist and could add a line that never ran (for example after a trailing line-continuation backtick).
    • Creates the profile file and its folder when needed.
    • Writes to $PROFILE.CurrentUserAllHosts by default, so the console, Windows Terminal and VS Code all load PowerStub. Pass -Path $PROFILE for the current host only.
    • Adds Import-Module PowerStub for a PowerShell Gallery install, or an import of the exact manifest path for a source or archive install.
    • Safe to run again: does nothing when the profile already imports PowerStub.
    • Changes nothing when the profile has syntax errors or the new line would not run as its own statement. Keeps the file's encoding and writes through symbolic links. Supports -WhatIf.
  • New Remove-PowerStubFromProfile command: removes the lines that import PowerStub from a profile, including ones added by hand. An import that shares a line with other code is left in place with a warning.

Whats Changed

  • feat(config): add Add-PowerStubToProfile and Remove-PowerStubFromProfile

Full Changelog: v2.2.1...v2.3.0