File tree 9 files changed +27
-8
lines changed
9 files changed +27
-8
lines changed Original file line number Diff line number Diff line change @@ -784,7 +784,7 @@ Process
784
784
return
785
785
}
786
786
787
- if (! (Test-Path " $home \Documents\WindowsPowerShell \Modules\Scripts\" ))
787
+ if (! (Test-Path " $home \Documents\$shell \Modules\Scripts\" ))
788
788
{
789
789
Write-Host
790
790
WriteWarn ' ... Could not find $home\Documents\WindowsPowerShell scripts'
Original file line number Diff line number Diff line change 35
35
{
36
36
. $PSScriptRoot \common.ps1
37
37
38
- $tools = ' C:\tools'
38
+ $script : tools = ' C:\tools'
39
39
$script :reminders = @ (@ ())
40
40
41
41
@@ -190,7 +190,7 @@ Begin
190
190
191
191
$themes = " $env: ProgramFiles \notepad++\themes"
192
192
New-Item $themes - ItemType Directory - Force
193
- Copy-Item " $home \Documents\WindowsPowerShell \Themes\Dark Selenitic npp.xml" " $themes \Dark Selenitic.xml"
193
+ Copy-Item " $home \Documents\$shell \Themes\Dark Selenitic npp.xml" " $themes \Dark Selenitic.xml"
194
194
195
195
# includes a dark-selenitic Markdown lang theme
196
196
$0 = " $ ( $env: APPDATA ) \Notepad++"
Original file line number Diff line number Diff line change 2
2
# Microsoft.PowerShell_profile.ps1 22 Jun 2013
3
3
# *************************************************************************************************
4
4
5
- $modules = Join-Path ([Environment ]::GetFolderPath([Environment + SpecialFolder ]::MyDocuments)) " WindowsPowerShell\Modules"
5
+ $script :shell = ' PowerShell'
6
+ if ($PSVersionTable.PSVersion.Major -lt 6 ) { $script :shell = ' WindowsPowerShell' }
7
+
8
+ $modules = Join-Path ([Environment ]::GetFolderPath([Environment + SpecialFolder ]::MyDocuments)) " $shell \Modules"
6
9
if (! $env: PSModulePath.Contains ($modules )) { $env: PSModulePath = $modules + " ;" + $env: PSModulePath }
7
10
8
11
Import-Module - Global - Name Addons.psd1
Original file line number Diff line number Diff line change 1
- . $env: USERPROFILE \Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
1
+ $script :shell = ' PowerShell'
2
+ if ($PSVersionTable.PSVersion.Major -lt 6 ) { $script :shell = ' WindowsPowerShell' }
3
+
4
+ . $env: USERPROFILE \Documents\$shell \Microsoft.PowerShell_profile.ps1
Original file line number Diff line number Diff line change @@ -5,8 +5,11 @@ Open the ISE profile definition script.
5
5
6
6
function Open-Profile ()
7
7
{
8
+ $shell = ' PowerShell'
9
+ if ($PSVersionTable.PSVersion.Major -lt 6 ) { $shell = ' WindowsPowerShell' }
10
+
8
11
$path = Join-Path ([Environment ]::GetFolderPath([Environment + SpecialFolder ]::MyDocuments)) `
9
- " WindowsPowerShell \Microsoft.PowerShellISE_profile.ps1"
12
+ " shell \Microsoft.PowerShellISE_profile.ps1"
10
13
11
14
if (! (Test-Path ($path )))
12
15
{
Original file line number Diff line number Diff line change @@ -169,9 +169,12 @@ Begin
169
169
$upaths = $usrPaths | % { ExpandPath $_ }
170
170
171
171
$ppaths = @ ()
172
+
173
+ $shell = ' PowerShell'
174
+ if ($PSVersionTable.PSVersion.Major -lt 6 ) { $shell = ' WindowsPowerShell' }
172
175
173
176
# PowerShell scripts are in path
174
- $psroot = Join-Path $env: USERPROFILE ' Documents\WindowsPowerShell \Modules\Scripts'
177
+ $psroot = Join-Path $env: USERPROFILE " Documents\$shell \Modules\Scripts"
175
178
176
179
# preserve per-session (process) entries
177
180
$env: Path -split ' ;' | % `
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ New-CommandWrapper Out-Default -Process {
2
2
$nocase = [Text.RegularExpressions.RegexOptions ]::IgnoreCase
3
3
$compressed = New-Object Text.RegularExpressions.Regex(' \.(zip|tar|gz|iso)$' , $nocase )
4
4
$executable = New-Object Text.RegularExpressions.Regex(' \.(exe|bat|cmd|msi|ps1|psm1)$' , $nocase )
5
+ $unix = New-Object Text.RegularExpressions.Regex(' \.(sh)$' , $nocase )
5
6
6
7
if (($_ -is [IO.DirectoryInfo ]) -or ($_ -is [IO.FileInfo ]))
7
8
{
@@ -53,6 +54,7 @@ New-CommandWrapper Out-Default -Process {
53
54
{
54
55
if ($compressed.IsMatch ($name )) { $color = ' Magenta' }
55
56
elseif ($executable.IsMatch ($name )) { $color = ' DarkGreen' }
57
+ elseif ($unix.IsMatch ($name )) { $color = ' Cyan' }
56
58
else { $color = ' Gray' }
57
59
58
60
# ensure size fits within the 11 char column
Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ Library of common functions shared by the Install-foo scripts.
4
4
5
5
$proEdition = $null
6
6
7
+ $script :shell = ' PowerShell'
8
+ if ($PSVersionTable.PSVersion.Major -lt 6 ) { $script :shell = ' WindowsPowerShell' }
9
+
7
10
8
11
function Chocolatize
9
12
{
Original file line number Diff line number Diff line change 1
1
# Copy all scripts in this project to %userprofile%\Documents\WindowsPowerShell
2
2
3
- $docPath = Join-Path ([Environment ]::GetFolderPath([Environment + SpecialFolder ]::MyDocuments)) " WindowsPowerShell"
3
+ . $PSScriptRoot \common.ps1
4
+
5
+ $docPath = Join-Path ([Environment ]::GetFolderPath([Environment + SpecialFolder ]::MyDocuments)) $shell
4
6
5
7
Copy-Item " $PSScriptRoot " " $docPath " - Recurse - Force - Exclude @ (" $this " )
You can’t perform that action at this time.
0 commit comments