-
Notifications
You must be signed in to change notification settings - Fork 8
Home
Powershell module built to handle anything you would want in your PowerShell profile, including module importing, script invoking, variable setting, command aliasing, etc. PSProfile also contains a Secret Vault to easily store and recall PSCredential and named SecureString objects.
In order to use this module, you will need the following PowerShell 5.1 or greater (PSProfile utilizes PowerShell classes under the hood).
- Open Powershell and run the following command:
Install-Module -Name PSProfile -Scope CurrentUser
For more information, please visit the PSProfile page on the Powershell Gallery
This will be equal to the Powershell Gallery, usually
- Click here to go to the latest releases, then download the PSProfile.zip file attached to the release
- Right-click the downloaded zip, select Properties, then unblock the file. This is to prevent having to unblock each file individually after unzipping.
- Unzip the archive.
- (Optional) Place the module somewhere in your PSModulePath.
- You can view the paths listed by running the environment variable
$env:PSModulePath
- You can view the paths listed by running the environment variable
Bleeding edge fans, contributors, etc
- Clone the repo to your computer:
git clone https://github.com/scrthq/PSProfile.git
- Open the cloned directory:
cd PSProfile
- Build the module:
.\build.ps1
Building with the default task list will automatically import the module at the end of the build.
If you'd like to import the compiled module in a new session, you can find it under the BuildOutput folder in the root of the repo.
OR
- Fork the repo to your local
- Import the module by loading the PSD1 file via full path or placing the local repo folder somewhere in your
$env:PSMODULEPATH
PSProfile is meant to take place of anything you currently are doing in your $profile
script, as well as add some additional features to enhance productivity and ease of use. Because of this, you should add the following line to your PowerShell profile after installing the module:
Import-Module PSProfile
This will automatically import your PSProfile whenever you open a new session. The easiest way to start is by running the following script to add it to your $profile
. The file will be created if it does not already exist.
if (-not (Test-Path $profile)) {
New-Item -ItemType File $profile -Force
}
'Import-Module PSProfile' | Add-Content $profile
Once PSProfile is imported, you'll have a new variable in your session, $PSProfile
.
PSProfile includes help and examples on every function, e.g.:
>> Get-Help Add-PSProfilePrompt
NAME
Add-PSProfilePrompt
SYNOPSIS
Saves the Content to $PSProfile.Prompts as the Name provided for recall later.
SYNTAX
Add-PSProfilePrompt [[-Name] <String>] [-Content <Object>] [-SetAsDefault] [<CommonParameters>]
DESCRIPTION
Saves the Content to $PSProfile.Prompts as the Name provided for recall later.
RELATED LINKS
REMARKS
To see the examples, type: "get-help Add-PSProfilePrompt -examples".
For more information, type: "get-help Add-PSProfilePrompt -detailed".
For technical information, type: "get-help Add-PSProfilePrompt -full"
It also includes handy HelpFiles for each concept:
>> Get-Help about_PSProfile*
Name Category Module Synopsis
---- -------- ------ --------
about_PSProfile HelpFile An overview of PSProfile module and its various components and concepts.
about_PSProfile_Command_Aliases HelpFile An overview of the Command Alias concept in PSProfile.
about_PSProfile_Configuration HelpFile An overview of the Configuration functions in PSProfile.
about_PSProfile_Helpers HelpFile An overview of the Helper functions in PSProfile.
about_PSProfile_Meta HelpFile An overview of the Meta functions in PSProfile.
about_PSProfile_Modules_to_Import HelpFile An overview of the Modules to Import concept in PSProfile.
about_PSProfile_Modules_to_Install HelpFile An overview of the Modules to Install concept in PSProfile.
about_PSProfile_Path_Aliases HelpFile An overview of the Path Alias concept in PSProfile.
about_PSProfile_Plugins HelpFile An overview of the Plugins concept in PSProfile.
about_PSProfile_Plugin_Paths HelpFile An overview of the Plugin Paths concept in PSProfile.
about_PSProfile_Project_Paths HelpFile An overview of the Project Paths concept in PSProfile.
about_PSProfile_Prompts HelpFile An overview of the Prompts concept in PSProfile.
about_PSProfile_Script_Paths HelpFile An overview of the Script Paths concept in PSProfile.
about_PSProfile_Secrets HelpFile An overview of the Secrets concept in PSProfile.
about_PSProfile_Symbolic_Links HelpFile An overview of the Symbolic Link concept in PSProfile.
about_PSProfile_Variables HelpFile An overview of the Variables concept in PSProfile.
- 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
- Export-PSProfileConfiguration
- Import-PSProfile
- Import-PSProfileConfiguration
- Save-PSProfile
- Start-PSProfileConfigurationHelper
- Update-PSProfileConfig
- Update-PSProfileRefreshFrequency
- Update-PSProfileSetting
- Add-PSProfileToProfile
- Copy-Parameters
- Get-LastCommandDuration
- Get-PathAlias
- Get-PSProfileArguments
- Get-PSVersion
- Test-IfGit
- Write-PSProfileLog
- Add-PSProfileInitScript
- Disable-PSProfileInitScript
- Edit-PSProfileInitScript
- Enable-PSProfileInitScript
- Get-PSProfileInitScript
- Remove-PSProfileInitScript
- Confirm-ScriptIsValid
- Enter-CleanEnvironment
- Format-Syntax
- Get-Definition
- Get-Gist
- Get-LongPath
- Install-LatestModule
- Open-Code
- Open-Item
- Pop-Path
- Push-Path
- Start-BuildScript
- Test-RegEx
- Add-PSProfilePrompt
- Edit-PSProfilePrompt
- Get-PSProfilePrompt
- Remove-PSProfilePrompt
- Switch-PSProfilePrompt