You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 0.4.0 - 2019-09-22
* [Issue #18](#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.
* 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.
Write-Host"Would you like to add an external script as an Init Script on your PSProfile?"
509
+
.$tip("Init Scripts are also invoked during PSProfile load. These differ from Script Paths in that the full script is stored on the PSProfile configuration itself. Init Scripts can also be disabled without being removed from PSProfile.")
510
+
.$tip("During this Configuration Helper, you are limited to providing a path to a script file to import as an Init Script. While using Add-PSProfileInitScript, however, you can provide a ScriptBlock or Strings of code directly if preferred.")
511
+
$decision=Read-Host"[Y] Yes [N] No [X] Exit"
512
+
do {
513
+
switch-Regex ($decision) {
514
+
"[Yy]" {
515
+
$item1=Read-Host"Please enter the path of the script to import as Init Script"
516
+
if ($null-eq (Get-PSProfileInitScript-Name (Get-Item$item1).BaseName)) {
517
+
if (-not$changeHash.ContainsKey('Init Scripts')) {
@@ -605,7 +643,7 @@ function Start-PSProfileConfigurationHelper {
605
643
}
606
644
until ($decision-notmatch"[Yy]")
607
645
}
608
-
12 {
646
+
13 {
609
647
if ($Global:PSProfile.Variables.Environment.Keys.Count-or$Global:PSProfile.Variables.Global.Keys.Count) {
610
648
.$current("`n`n~~ ENVIRONMENT ~~`n$(($Global:PSProfile.Variables.Environment|Out-String).Trim())`n`n~~ GLOBAL ~~`n$(($Global:PSProfile.Variables.Global|Out-String).Trim())")
611
649
}
@@ -656,25 +694,25 @@ function Start-PSProfileConfigurationHelper {
656
694
}
657
695
until ($decision-notmatch"[Yy]")
658
696
}
659
-
13 {
697
+
14 {
660
698
"Power Tools functions do not alter the PSProfile configuration, so there is nothing to configure with this Helper! Please see the HelpTopic '$helpTopic' for more info:"|Write-Host
661
699
.$command("Get-Help $helpTopic")
662
700
""|Write-Host
663
701
Read-Host"Press [Enter] to continue"
664
702
}
665
-
14 {
703
+
15 {
666
704
"Configuration functions are meant to interact with the PSProfile configuration directly, so there is nothing to configure with this Helper! Please see the HelpTopic '$helpTopic' for more info:"|Write-Host
667
705
.$command("Get-Help $helpTopic")
668
706
""|Write-Host
669
707
Read-Host"Press [Enter] to continue"
670
708
}
671
-
15 {
709
+
16 {
672
710
"Helper functions are meant to interact for use within prompts or add Log Events to PSProfile, so there is nothing to configure with this Helper! Please see the HelpTopic '$helpTopic' for more info:"|Write-Host
673
711
.$command("Get-Help $helpTopic")
674
712
""|Write-Host
675
713
Read-Host"Press [Enter] to continue"
676
714
}
677
-
16 {
715
+
17 {
678
716
"Meta functions are meant to provide information about PSProfile itself, so there is nothing to configure with this Helper! Please see the HelpTopic '$helpTopic' for more info:"|Write-Host
0 commit comments