Skip to content

Commit fd56aec

Browse files
committed
shell
1 parent ee92ebb commit fd56aec

9 files changed

+27
-8
lines changed

Initialize-Machine.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ Process
784784
return
785785
}
786786

787-
if (!(Test-Path "$home\Documents\WindowsPowerShell\Modules\Scripts\"))
787+
if (!(Test-Path "$home\Documents\$shell\Modules\Scripts\"))
788788
{
789789
Write-Host
790790
WriteWarn '... Could not find $home\Documents\WindowsPowerShell scripts'

Install-Programs.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Begin
3535
{
3636
. $PSScriptRoot\common.ps1
3737

38-
$tools = 'C:\tools'
38+
$script:tools = 'C:\tools'
3939
$script:reminders = @(@())
4040

4141

@@ -190,7 +190,7 @@ Begin
190190

191191
$themes = "$env:ProgramFiles\notepad++\themes"
192192
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"
194194

195195
# includes a dark-selenitic Markdown lang theme
196196
$0 = "$($env:APPDATA)\Notepad++"

Microsoft.PowerShellISE_profile.ps1

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
# Microsoft.PowerShell_profile.ps1 22 Jun 2013
33
#*************************************************************************************************
44

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"
69
if (!$env:PSModulePath.Contains($modules)) { $env:PSModulePath = $modules + ";" + $env:PSModulePath }
710

811
Import-Module -Global -Name Addons.psd1

Microsoft.VSCode_profile.ps1

+4-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
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

Modules/Addons/Open-Profile.psm1

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ Open the ISE profile definition script.
55

66
function Open-Profile ()
77
{
8+
$shell = 'PowerShell'
9+
if ($PSVersionTable.PSVersion.Major -lt 6) { $shell = 'WindowsPowerShell' }
10+
811
$path = Join-Path ([Environment]::GetFolderPath([Environment+SpecialFolder]::MyDocuments)) `
9-
"WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1"
12+
"shell\Microsoft.PowerShellISE_profile.ps1"
1013

1114
if (!(Test-Path($path)))
1215
{

Modules/Scripts/Repair-Path.ps1

+4-1
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,12 @@ Begin
169169
$upaths = $usrPaths | % { ExpandPath $_ }
170170

171171
$ppaths = @()
172+
173+
$shell = 'PowerShell'
174+
if ($PSVersionTable.PSVersion.Major -lt 6) { $shell = 'WindowsPowerShell' }
172175

173176
# 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"
175178

176179
# preserve per-session (process) entries
177180
$env:Path -split ';' | % `

Modules/Scripts/Set-OutDefaultOverride.ps1

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ New-CommandWrapper Out-Default -Process {
22
$nocase = [Text.RegularExpressions.RegexOptions]::IgnoreCase
33
$compressed = New-Object Text.RegularExpressions.Regex('\.(zip|tar|gz|iso)$', $nocase)
44
$executable = New-Object Text.RegularExpressions.Regex('\.(exe|bat|cmd|msi|ps1|psm1)$', $nocase)
5+
$unix = New-Object Text.RegularExpressions.Regex('\.(sh)$', $nocase)
56

67
if (($_ -is [IO.DirectoryInfo]) -or ($_ -is [IO.FileInfo]))
78
{
@@ -53,6 +54,7 @@ New-CommandWrapper Out-Default -Process {
5354
{
5455
if ($compressed.IsMatch($name)) { $color = 'Magenta' }
5556
elseif ($executable.IsMatch($name)) { $color = 'DarkGreen' }
57+
elseif ($unix.IsMatch($name)) { $color = 'Cyan' }
5658
else { $color = 'Gray' }
5759

5860
# ensure size fits within the 11 char column

common.ps1

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Library of common functions shared by the Install-foo scripts.
44

55
$proEdition = $null
66

7+
$script:shell = 'PowerShell'
8+
if ($PSVersionTable.PSVersion.Major -lt 6) { $script:shell = 'WindowsPowerShell' }
9+
710

811
function Chocolatize
912
{

publish.ps1

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Copy all scripts in this project to %userprofile%\Documents\WindowsPowerShell
22

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
46

57
Copy-Item "$PSScriptRoot" "$docPath" -Recurse -Force -Exclude @("$this")

0 commit comments

Comments
 (0)