Skip to content

Commit

Permalink
!deploy v0.1.5 with a couple fixes and new features
Browse files Browse the repository at this point in the history
## 0.1.5 - 2019-08-22

* Added `Export-PSProfileConfiguration` to export your configuration to a portable file.
* Fixed bug with `Edit-PSProfilePrompt` that tried to run a non-existent function after editing was finished.
* Swapped the `Temporary` switch parameter with `Save` on `Edit-PSProfilePrompt` to align with the rest of the functions.
* Updated the `_loadPrompt()` method on the `$PSProfile` object to not force load a default prompt if a default prompt name has not been specified yet.
* Updated README with better details.
* Updated Wiki content.
* Updated CONTRIBUTING.md.
  • Loading branch information
scrthq committed Aug 23, 2019
1 parent 23de1d4 commit 4e26f91
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 23 deletions.
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* [PSProfile - ChangeLog](#psprofile---changelog)
* [0.1.5 - 2019-08-22](#015---2019-08-22)
* [0.1.4 - 2019-08-22](#014---2019-08-22)
* [0.1.3 - 2019-08-20](#013---2019-08-20)
* [0.1.2 - 2019-08-20](#012---2019-08-20)
Expand All @@ -9,11 +10,21 @@

# PSProfile - ChangeLog

## 0.1.5 - 2019-08-22

* Added `Export-PSProfileConfiguration` to export your configuration to a portable file.
* Fixed bug with `Edit-PSProfilePrompt` that tried to run a non-existent function after editing was finished.
* Swapped the `Temporary` switch parameter with `Save` on `Edit-PSProfilePrompt` to align with the rest of the functions.
* Updated the `_loadPrompt()` method on the `$PSProfile` object to not force load a default prompt if a default prompt name has not been specified yet.
* Updated README with better details.
* Updated Wiki content.
* Updated CONTRIBUTING.md.

## 0.1.4 - 2019-08-22

* Added conceptual HelpFiles. Run `Get-Help about_PSProfile*` for more info!
* Added argument completer for `Add-PSProfilePlugin`
* Updated Wiki content
* Added argument completer for `Add-PSProfilePlugin`.
* Updated Wiki content.

## 0.1.3 - 2019-08-20

Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Contributing to PEMEncrypt
# Contributing to PSProfile

<!-- TOC -->

* [Contributing to PEMEncrypt](#contributing-to-pemencrypt)
* [Contributing to PSProfile](#contributing-to-psprofile)
* [Git and Pull requests](#git-and-pull-requests)
* [Overview](#overview)
* [Step by Step (High-Level)](#step-by-step-high-level)
Expand All @@ -11,9 +11,9 @@

<!-- /TOC -->

Thank you for your interest in helping PEMEncrypt grow! Below you'll find some guidelines around developing additional features and squashing bugs, including some how-to's to get started quick, general style guidelines, etc.
Thank you for your interest in helping PSProfile grow! Below you'll find some guidelines around developing additional features and squashing bugs, including some how-to's to get started quick, general style guidelines, etc.

[![Waffle.io - Columns and their card count](https://badge.waffle.io/scrthq/PEMEncrypt.svg?columns=all)](https://waffle.io/scrthq/PEMEncrypt)
[![Waffle.io - Columns and their card count](https://badge.waffle.io/scrthq/PSProfile.svg?columns=all)](https://waffle.io/scrthq/PSProfile)

## Git and Pull requests

Expand Down
25 changes: 18 additions & 7 deletions PSProfile/Classes/PSProfile.Classes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ class PSProfile {
$this.Log = [System.Collections.Generic.List[PSProfileEvent]]::new()
$this.Vault = [PSProfileVault]::new()
$this._internal = @{ }
$this.GitPathMap = @{
PSProfileConfiguration = (Join-Path (Get-ConfigurationPath -CompanyName 'SCRT HQ' -Name PSProfile) 'Configuration.psd1')
}
$this.GitPathMap = @{ }
$this.PSBuildPathMap = @{ }
$this.SymbolicLinks = @{ }
$this.Prompts = @{
Expand Down Expand Up @@ -176,8 +174,9 @@ class PSProfile {
}
}
$this.Settings = @{
DefaultPrompt = 'Default'
PSVersionStringLength = 3
DefaultPrompt = $null
PSVersionStringLength = 3
ConfigurationPath = (Join-Path (Get-ConfigurationPath -CompanyName 'SCRT HQ' -Name PSProfile) 'Configuration.psd1')
}
$this.RefreshFrequency = (New-TimeSpan -Hours 1).ToString()
$this.LastRefresh = [datetime]::Now.AddHours(-2)
Expand Down Expand Up @@ -287,8 +286,20 @@ class PSProfile {
"LoadPrompt",
"Debug"
)
if ($null -ne $global:PSProfile.Settings.DefaultPrompt) {
Switch-PSProfilePrompt -Name $global:PSProfile.Settings.DefaultPrompt
if ($null -ne $this.Settings.DefaultPrompt) {
$this._log(
"Loading default prompt: $($this.Settings.DefaultPrompt)",
"LoadPrompt",
"Verbose"
)
Switch-PSProfilePrompt -Name $this.Settings.DefaultPrompt
}
else {
$this._log(
"No default prompt name found on PSProfile. Retaining current prompt.",
"LoadPrompt",
"Verbose"
)
}
$this._log(
"SECTION END",
Expand Down
2 changes: 1 addition & 1 deletion PSProfile/PSProfile.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PSProfile.psm1'

# Version number of this module.
ModuleVersion = '0.1.4'
ModuleVersion = '0.1.5'

# Supported PSEditions
CompatiblePSEditions = @('Desktop','Core')
Expand Down
12 changes: 6 additions & 6 deletions PSProfile/Public/Prompts/Edit-PSProfilePrompt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ function Edit-PSProfilePrompt {
.DESCRIPTION
Enables editing the prompt from the desired editor. Once temporary file is saved, the prompt is updated in $PSProfile.Prompts.
.PARAMETER Temporary
If $true, does not save the PSProfile after updating the prompt.
.PARAMETER Save
If $true, saves prompt back to your PSProfile after updating.
.EXAMPLE
Edit-PSProfilePrompt
Opens the current prompt as a temporary file in Visual Studio Code to edit. Once the file is saved and closed, the prompt is updated with the changes and saved back to $PSProfile.
Opens the current prompt as a temporary file in Visual Studio Code to edit. Once the file is saved and closed, the active prompt is updated with the changes.
#>
[CmdletBinding()]
Param(
[Parameter()]
[Switch]
$Temporary
$Save
)
Process {
$in = @{
Expand Down Expand Up @@ -47,8 +47,8 @@ function Edit-PSProfilePrompt {
}
Write-Verbose "Opening prompt in VS Code"
.$handler($in)
if (-not $Temporary) {
Save-PSProfilePrompt
if ($Save) {
Add-PSProfilePrompt
}
}
}
7 changes: 7 additions & 0 deletions PSProfile/en-US/about_PSProfile_Configuration.help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ LONG DESCRIPTION
object directly for convenience.

COMMANDS
* `Export-PSProfileConfiguration`
Exports the PSProfile configuration to the desired path for portability.

*Any secrets stored in the `$PSProfile.Vault` will be exported, but
will be unable to be decrypted on another machine or by another user on
the same machine due to encryption via Data Protection API.*

* `Import-PSProfile`
Invokes `$PSProfile.Load()` to run through the actions typically performed
during the initial import of PSProfile. Useful when adding new items to
Expand Down
96 changes: 93 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# PSProfile

_PSProfile is a cross-platform PowerShell module built for profile customization. It uses PoshCode's Configuration module to handle the layered Configuration._
PSProfile is a cross-platform PowerShell module built for profile customization. It uses PoshCode's Configuration module to handle the layered Configuration.

***

<div align="center">
<!-- Azure Pipelines -->
Expand Down Expand Up @@ -43,6 +45,18 @@ _PSProfile is a cross-platform PowerShell module built for profile customization
</div>
<br />

* [PSProfile](#psprofile)
* [Background](#background)
* [Quick Start](#quick-start)
* [Getting Help](#getting-help)
* [Tips & Tricks](#tips--tricks)
* [ProjectPaths](#projectpaths)
* [ScriptPaths](#scriptpaths)
* [Contributing](#contributing)
* [Code of Conduct](#code-of-conduct)
* [License](#license)
* [Changelog](#changelog)

## Background

I do a LOT of profile customization, including loading in various custom functions I wrote, setting certain variables, invoking external profile scripts, etc, to make everyday tasks more efficient. I checked out the PowerShell Gallery for other Profile management modules but none seemed to satisfy all of the goals I had:
Expand Down Expand Up @@ -74,7 +88,61 @@ I hope that you enjoy PSProfile as much as I do! It includes a TON of convenienc
'Import-Module PSProfile' | Add-Content $profile
```
3. Restart your session or run `Import-Module PSProfile` to start working with it directly.
4. Explore the new `$PSProfile` variable containing the current PSProfile configuration.
## Getting Help
PSProfile includes help and examples on every function, e.g.:
```powershell
>> 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:

```powershell
>> 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.
```

## Tips & Tricks

Expand Down Expand Up @@ -106,4 +174,26 @@ This adds the script specified to `$PSProfile.ScriptPaths`. Any scripts here wil

***

_More info / tips here soon! View the [PSProfile wiki](https://github.com/scrthq/PSProfile/wiki) for full function help and other topics._
## Contributing

Interested in helping out with PSProfile development? Please check out our [Contribution Guidelines](https://github.com/scrthq/PSProfile/blob/master/CONTRIBUTING.md)!

Building the module locally to test changes is as easy as running the `build.ps1` file in the root of the repo. This will compile the module with your changes and import the newly compiled module at the end by default.

Want to run the Pester tests locally? Pass `Test` as the value to the `Task` script parameter like so:

```powershell
.\build.ps1 -Task Test
```

## Code of Conduct

Please adhere to our [Code of Conduct](https://github.com/scrthq/PSProfile/blob/master/CODE_OF_CONDUCT.md) when interacting with this repo.

## License

[Apache 2.0](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0))

## Changelog

[Full CHANGELOG here](https://github.com/scrthq/PSProfile/blob/master/CHANGELOG.md)

0 comments on commit 4e26f91

Please sign in to comment.