Skip to content

Commit

Permalink
v0.4.1 release
Browse files Browse the repository at this point in the history
## 0.4.1 - 2019-10-08

* Miscellaneous
    * Added `LastSave` property to the primary `PSProfile` class
    * Added check on `Save()` method to pull in updated configuration if it has been saved from another session by comparing `LastSave` DateTime between the configuration and current `$PSProfile.LastSave`
  • Loading branch information
scrthq committed Oct 8, 2019
1 parent 4781379 commit 5e3ebcf
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 133 deletions.
265 changes: 136 additions & 129 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,101 @@
* [PSProfile - ChangeLog](#psprofile---changelog)
* [0.4.0 - 2019-09-22](#040---2019-09-22)
* [0.3.0 - 2019-09-07](#030---2019-09-07)
* [0.2.0 - 2019-09-02](#020---2019-09-02)
* [0.1.9 - 2019-08-26](#019---2019-08-26)
* [0.1.8 - 2019-08-26](#018---2019-08-26)
* [0.1.7 - 2019-08-25](#017---2019-08-25)
* [0.1.6 - 2019-08-24](#016---2019-08-24)
* [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)
* [0.1.1 - 2019-08-19](#011---2019-08-19)
* [0.1.0 - 2019-08-19](#010---2019-08-19)
* [0.4.1 - 2019-10-08](#041---2019-10-08)
* [0.4.0 - 2019-09-22](#040---2019-09-22)
* [0.3.0 - 2019-09-07](#030---2019-09-07)
* [0.2.0 - 2019-09-02](#020---2019-09-02)
* [0.1.9 - 2019-08-26](#019---2019-08-26)
* [0.1.8 - 2019-08-26](#018---2019-08-26)
* [0.1.7 - 2019-08-25](#017---2019-08-25)
* [0.1.6 - 2019-08-24](#016---2019-08-24)
* [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)
* [0.1.1 - 2019-08-19](#011---2019-08-19)
* [0.1.0 - 2019-08-19](#010---2019-08-19)

***

# PSProfile - ChangeLog

## 0.4.1 - 2019-10-08

* Miscellaneous
* Added `LastSave` property to the primary `PSProfile` class
* Added check on `Save()` method to pull in updated configuration if it has been saved from another session by comparing `LastSave` DateTime between the configuration and current `$PSProfile.LastSave`

## 0.4.0 - 2019-09-22

* [Issue #18](https://github.com/scrthq/PSProfile/issues/18)
* Added the following functions for Init Script management:
* `Add-PSProfileInitScript`
* `Get-PSProfileInitScript`
* `Remove-PSProfileInitScript`
* `Enable-PSProfileInitScript`
* `Disable-PSProfileInitScript`
* `Edit-PSProfileInitScript`
* Added contextual help file `about_PSProfile_Init_Scripts`
* Added Init Scripts section to `Start-PSProfileConfigurationHelper`
* Updated `PSProfile` class to include Init Script support.
* Added the following functions for Init Script management:
* `Add-PSProfileInitScript`
* `Get-PSProfileInitScript`
* `Remove-PSProfileInitScript`
* `Enable-PSProfileInitScript`
* `Disable-PSProfileInitScript`
* `Edit-PSProfileInitScript`
* Added contextual help file `about_PSProfile_Init_Scripts`
* Added Init Scripts section to `Start-PSProfileConfigurationHelper`
* Updated `PSProfile` class to include Init Script support.
* Miscellaneous
* Updated `Edit-PSProfilePrompt` when choosing to Save PSProfile to ensure the updated prompt is written back to disk.
* Updated `invoke.build.ps1` for better contextual verbosity when compiling the module during the build process.
* Updated `Edit-PSProfilePrompt` when choosing to Save PSProfile to ensure the updated prompt is written back to disk.
* Updated `invoke.build.ps1` for better contextual verbosity when compiling the module during the build process.

## 0.3.0 - 2019-09-07

* [Issue #15](https://github.com/scrthq/PSProfile/issues/15)
* Added `Add-PSProfileToProfile` function to easily add `Import-Module PSProfile` to your PowerShell profile.
* Added `Add-PSProfileToProfile` function to easily add `Import-Module PSProfile` to your PowerShell profile.
* [Issue #16](https://github.com/scrthq/PSProfile/issues/16)
* Added the following functions from the `PSProfile.PowerTools` plugin to PSProfile directly:
* `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`
* Added HelpFile for Power Tools functions: `Get-Help about_PSProfile_Power_Tools`
* Updated `Start-PSProfileConfigurationHelper` with Power Tools section
* Added the following functions from the `PSProfile.PowerTools` plugin to PSProfile directly:
* `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`
* Added HelpFile for Power Tools functions: `Get-Help about_PSProfile_Power_Tools`
* Updated `Start-PSProfileConfigurationHelper` with Power Tools section
* Miscellaneous
* Cleaned up `PSProfile` class.
* Updated alias list.
* Updated module versioning strategy in build script.
* Updated `GitAliases` plugin to only spawn 1 runspace in the background.
* Fixed issue with `Copy-Parameters` where it would fail to pull parameters for commands with multiple parameter sets.
* Updated Content.Tests.
* Updated azure-pipelines YAML.
* Renamed the InvokeBuild script from `tasks.build.ps1` to `invoke.build.ps1`.
* Cleaned up `PSProfile` class.
* Updated alias list.
* Updated module versioning strategy in build script.
* Updated `GitAliases` plugin to only spawn 1 runspace in the background.
* Fixed issue with `Copy-Parameters` where it would fail to pull parameters for commands with multiple parameter sets.
* Updated Content.Tests.
* Updated azure-pipelines YAML.
* Renamed the InvokeBuild script from `tasks.build.ps1` to `invoke.build.ps1`.

## 0.2.0 - 2019-09-02

* [Issue #2](https://github.com/scrthq/PSProfile/issues/2)
* Added special module import process when the `ModuleToImport` is `EditorServicesCommandSuite` so it also automatically registers the available editor commands.
* Added special module import process when the `ModuleToImport` is `EditorServicesCommandSuite` so it also automatically registers the available editor commands.
* [Issue #12](https://github.com/scrthq/PSProfile/issues/12)
* Added `Start-PSProfileConfigurationHelper` to provide an easy way to get started with configuring your PSProfile.
* Added `Start-PSProfileConfigurationHelper` to provide an easy way to get started with configuring your PSProfile.
* [Issue #6](https://github.com/scrthq/PSProfile/issues/6)
* Added `PSReadline` key to `$PSProfile.Settings` (Settings management in development still.)
* Added `PSReadline` key to `$PSProfile.Settings` (Settings management in development still.)
* Miscellaneous
* Added support for multiple Command Aliases to be removed at once with `Remove-PSProfileCommandAlias`.
* Updated default `SCRTHQ` prompt that comes with the module.
* Added support for NerdFonts and PowerLine switches on the prompts to switch char sets depending on the FontType.
* Added `IncludeVault` switch parameter to `Export-PSProfileConfiguration` to prevent exporting the Secrets Vault by default when creating portable configurations.
* Added `_cleanModules()` method to PSProfile class to remove any null or empty values hanging over and convert any string values to the full hashtable value instead.
* Cleaned up logic and fixed bugs in the following functions:
* `Add-PSProfileModuleToImport`
* `Remove-PSProfileModuleToImport`
* `Add-PSProfileModuleToInstall`
* `Remove-PSProfileModuleToInstall`
* `Add-PSProfilePlugin`
* Updated CONTRIBUTING.md with snippet to include for PSProfile developers on their PowerShell profile.
* Refactored `Get-PSProfilePrompt` to return `$null` if a name is specified but does not exist on the current PSProfile configuration.
* Refactored `$PSProfile._loadConfiguration()` to start with the base value of `$Global:PSProfile` if present, otherwise import the existing configuration from file. This is necessary to retain the existing configuration if an action is taken that forces the PSProfile to reload, e.g. adding a new plugin to the configuration.
* Updated `$PSProfile._loadPrompt()` method to set the value of `$function:prompt` directly instead of calling `Switch-PSProfilePrompt` to reduce overhead.
* Added support for multiple Command Aliases to be removed at once with `Remove-PSProfileCommandAlias`.
* Updated default `SCRTHQ` prompt that comes with the module.
* Added support for NerdFonts and PowerLine switches on the prompts to switch char sets depending on the FontType.
* Added `IncludeVault` switch parameter to `Export-PSProfileConfiguration` to prevent exporting the Secrets Vault by default when creating portable configurations.
* Added `_cleanModules()` method to PSProfile class to remove any null or empty values hanging over and convert any string values to the full hashtable value instead.
* Cleaned up logic and fixed bugs in the following functions:
* `Add-PSProfileModuleToImport`
* `Remove-PSProfileModuleToImport`
* `Add-PSProfileModuleToInstall`
* `Remove-PSProfileModuleToInstall`
* `Add-PSProfilePlugin`
* Updated CONTRIBUTING.md with snippet to include for PSProfile developers on their PowerShell profile.
* Refactored `Get-PSProfilePrompt` to return `$null` if a name is specified but does not exist on the current PSProfile configuration.
* Refactored `$PSProfile._loadConfiguration()` to start with the base value of `$Global:PSProfile` if present, otherwise import the existing configuration from file. This is necessary to retain the existing configuration if an action is taken that forces the PSProfile to reload, e.g. adding a new plugin to the configuration.
* Updated `$PSProfile._loadPrompt()` method to set the value of `$function:prompt` directly instead of calling `Switch-PSProfilePrompt` to reduce overhead.

## 0.1.9 - 2019-08-26

Expand Down Expand Up @@ -149,70 +156,70 @@
## 0.1.1 - 2019-08-19

* [Issue #3](https://github.com/scrthq/PSProfile/issues/3)
* Fixed: `$PSProfile.Refresh()` only uses `Trim()` to clean up the Prompts now due to Invoke-Formatter hanging.
* Fixed: `$PSProfile.Refresh()` only uses `Trim()` to clean up the Prompts now due to Invoke-Formatter hanging.

## 0.1.0 - 2019-08-19

* Initial release to the PowerShell Gallery
* Included functions:
* `Add-PSProfileCommandAlias`
* `Add-PSProfileModuleToImport`
* `Add-PSProfileModuleToInstall`
* `Add-PSProfilePathAlias`
* `Add-PSProfilePlugin`
* `Add-PSProfileProjectPath`
* `Add-PSProfilePrompt`
* `Add-PSProfileScriptPath`
* `Add-PSProfileSecret`
* `Add-PSProfileSymbolicLink`
* `Add-PSProfileVariable`
* `Edit-PSProfilePrompt`
* `Get-LastCommandDuration`
* `Get-MyCreds`
* `Get-PathAlias`
* `Get-PSProfileArguments`
* `Get-PSProfileCommand`
* `Get-PSProfileCommandAlias`
* `Get-PSProfileImportedCommand`
* `Get-PSProfileLog`
* `Get-PSProfileModuleToImport`
* `Get-PSProfileModuleToInstall`
* `Get-PSProfilePathAlias`
* `Get-PSProfilePlugin`
* `Get-PSProfileProjectPath`
* `Get-PSProfilePrompt`
* `Get-PSProfileScriptPath`
* `Get-PSProfileSecret`
* `Get-PSProfileSymbolicLink`
* `Get-PSProfileVariable`
* `Get-PSVersion`
* `Import-PSProfile`
* `Import-PSProfileConfiguration`
* `Remove-PSProfileCommandAlias`
* `Remove-PSProfileModuleToImport`
* `Remove-PSProfileModuleToInstall`
* `Remove-PSProfilePathAlias`
* `Remove-PSProfilePlugin`
* `Remove-PSProfileProjectPath`
* `Remove-PSProfilePrompt`
* `Remove-PSProfileScriptPath`
* `Remove-PSProfileSecret`
* `Remove-PSProfileSymbolicLink`
* `Remove-PSProfileVariable`
* `Save-PSProfile`
* `Switch-PSProfilePrompt`
* `Test-IfGit`
* `Update-PSProfileConfig`
* `Update-PSProfileRefreshFrequency`
* `Update-PSProfileSetting`
* `Write-PSProfileLog`
* `Add-PSProfileCommandAlias`
* `Add-PSProfileModuleToImport`
* `Add-PSProfileModuleToInstall`
* `Add-PSProfilePathAlias`
* `Add-PSProfilePlugin`
* `Add-PSProfileProjectPath`
* `Add-PSProfilePrompt`
* `Add-PSProfileScriptPath`
* `Add-PSProfileSecret`
* `Add-PSProfileSymbolicLink`
* `Add-PSProfileVariable`
* `Edit-PSProfilePrompt`
* `Get-LastCommandDuration`
* `Get-MyCreds`
* `Get-PathAlias`
* `Get-PSProfileArguments`
* `Get-PSProfileCommand`
* `Get-PSProfileCommandAlias`
* `Get-PSProfileImportedCommand`
* `Get-PSProfileLog`
* `Get-PSProfileModuleToImport`
* `Get-PSProfileModuleToInstall`
* `Get-PSProfilePathAlias`
* `Get-PSProfilePlugin`
* `Get-PSProfileProjectPath`
* `Get-PSProfilePrompt`
* `Get-PSProfileScriptPath`
* `Get-PSProfileSecret`
* `Get-PSProfileSymbolicLink`
* `Get-PSProfileVariable`
* `Get-PSVersion`
* `Import-PSProfile`
* `Import-PSProfileConfiguration`
* `Remove-PSProfileCommandAlias`
* `Remove-PSProfileModuleToImport`
* `Remove-PSProfileModuleToInstall`
* `Remove-PSProfilePathAlias`
* `Remove-PSProfilePlugin`
* `Remove-PSProfileProjectPath`
* `Remove-PSProfilePrompt`
* `Remove-PSProfileScriptPath`
* `Remove-PSProfileSecret`
* `Remove-PSProfileSymbolicLink`
* `Remove-PSProfileVariable`
* `Save-PSProfile`
* `Switch-PSProfilePrompt`
* `Test-IfGit`
* `Update-PSProfileConfig`
* `Update-PSProfileRefreshFrequency`
* `Update-PSProfileSetting`
* `Write-PSProfileLog`
* Included aliases:
* `Creds` >> `Get-MyCreds`
* `Edit-Prompt` >> `Edit-PSProfilePrompt`
* `Get-Prompt` >> `Get-PSProfilePrompt`
* `Load-PSProfile` >> `Import-PSProfile`
* `Refresh-PSProfile` >> `Update-PSProfileConfig`
* `Remove-Prompt` >> `Remove-PSProfilePrompt`
* `Save-Prompt` >> `Add-PSProfilePrompt`
* `Set-Prompt` >> `Switch-PSProfilePrompt`
* `Switch-Prompt` >> `Switch-PSProfilePrompt`
* `Creds` >> `Get-MyCreds`
* `Edit-Prompt` >> `Edit-PSProfilePrompt`
* `Get-Prompt` >> `Get-PSProfilePrompt`
* `Load-PSProfile` >> `Import-PSProfile`
* `Refresh-PSProfile` >> `Update-PSProfileConfig`
* `Remove-Prompt` >> `Remove-PSProfilePrompt`
* `Save-Prompt` >> `Add-PSProfilePrompt`
* `Set-Prompt` >> `Switch-PSProfilePrompt`
* `Switch-Prompt` >> `Switch-PSProfilePrompt`
27 changes: 27 additions & 0 deletions PSProfile/Classes/PSProfile.Classes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class PSProfile {
[hashtable] $_internal
[hashtable] $Settings
[datetime] $LastRefresh
[datetime] $LastSave
[string] $RefreshFrequency
[hashtable] $GitPathMap
[hashtable] $PSBuildPathMap
Expand Down Expand Up @@ -156,6 +157,7 @@ class PSProfile {
}
$this.RefreshFrequency = (New-TimeSpan -Hours 1).ToString()
$this.LastRefresh = [datetime]::Now.AddHours(-2)
$this.LastSave = [datetime]::Now
$this.ProjectPaths = @()
$this.PluginPaths = @()
$this.InitScripts = @{}
Expand Down Expand Up @@ -298,13 +300,38 @@ if ($env:AWS_PROFILE) {
$this._formatInitScripts()
$this.LastRefresh = [datetime]::Now
$this.Save()
$this._log(
"Refresh complete",
"MAIN",
"Verbose"
)
}
[void] Save() {
$this._log(
"Saving PSProfile configuration",
"MAIN",
"Debug"
)
$conf = Import-Configuration -Name PSProfile -CompanyName 'SCRT HQ' -DefaultPath (Join-Path $PSScriptRoot "Configuration.psd1")
if ($conf.LastSave -gt $this.LastSave) {
$this._log(
"Configuration has been updated from another session @ $($conf.LastSave). Pulling in updated configuration before saving.",
"MAIN",
"Verbose"
)
$this | Update-Object $conf
}
$out = @{ }
$this.LastSave = [DateTime]::Now
$this.PSObject.Properties.Name | Where-Object { $_ -ne '_internal' } | ForEach-Object {
$out[$_] = $this.$_
}
$out | Export-Configuration -Name PSProfile -CompanyName 'SCRT HQ'
$this._log(
"PSProfile configuration has been saved.",
"MAIN",
"Verbose"
)
}
hidden [string] _globalize([string]$content) {
$noScopePattern = 'function\s+(?<Name>[\w+_-]{1,})\s+\{'
Expand Down
Loading

0 comments on commit 5e3ebcf

Please sign in to comment.