Skip to content

Power Tools

Nate Ferrell edited this page Sep 8, 2019 · 1 revision

Synopsis

An overview of the Power Tools functions in PSProfile.

Description

The Power Tools functions in PSProfile are helper functions focused on boosting productivity by taking advantage of PSProfile's mapped project paths for quick tab completion and project management.

Commands

Uses the PSParser to check for any errors in a script file.

Enters a clean environment with -NoProfile and sets a couple of convenience settings i.e. a prompt to advise you are in a clean environment and some PSReadline helper settings.

Formats a command's syntax in an easy-to-read view.

Convenience function to easily get the defition of a function

Gets a GitHub Gist's contents using the public API

Expands a short-alias from the GitPathMap to the full path

Uninstalls any existing versions of the target module before installing the latest one. Defaults to CurrentUser scope when installing the latest module version from the desired repository.

A drop-in replacement for the Visual Studio Code CLI code. Allows tab-completion of GitPath aliases if ProjectPaths are filled out with PSProfile that expand to the full path when invoked.

Recommendation: Add a Command Alias to override the existing code CLI command to point at Open-Code instead:

Add-PSProfileCommandAlias -Alias code -Command Open-Code -Save

Opens the item specified using Invoke-Item. Allows tab-completion of GitPath aliases if ProjectPaths are filled out with PSProfile that expand to the full path when invoked.

Pops your location back the path you Push-Path'd from.

Pushes your current location to the path specified. Allows tab-completion of GitPath aliases if ProjectPaths are filled out with PSProfile that expand to the full path when invoked. Use Pop-Path to return to the location pushed from, as locations pushed from this function are within the module scope.

For those using the typical build.ps1 build scripts for PowerShell projects, this will allow invoking the build script quickly from wherever folder you are currently in using a child process. Any projects in the ProjectPaths list that were discovered during PSProfile load and have a build.ps1 file will be able to be tab-completed for convenience. Temporarily sets the path to the build folder, invokes the build.ps1 file, then returns to the original path that it was invoked from.

Tests a RegEx pattern against a string and returns the results.

PSProfile

Concepts

Function Help

Command Aliases

Configuration

Helpers

Init Scripts

Meta

Modules to Import

Modules to Install

Path Aliases

Plugin Paths

Plugins

Power Tools

Project Paths

Prompts

Script Paths

Secrets

Symbolic Links

Variables

Badges

Azure Pipelines      Discord - Chat      Slack - Chat      Codacy PowerShell Gallery      GitHub Releases      GitHub Releases

Clone this wiki locally