File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change
1
+ statements.ps1
2
+ Get-Profile.ps1
3
+ Get-StrictMode.ps1
4
+ Import-BatchEnvironment.ps1
Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2023 Matthias Wolf, Mawosoft.
2
+
3
+ Set-StrictMode - Version 3
4
+ $ErrorActionPreference = ' Stop'
5
+
6
+ # One history across all hosts per user
7
+ Set-PSReadLineOption - HistorySavePath (Join-Path (
8
+ [System.Environment ]::GetFolderPath([System.Environment + SpecialFolder ]::MyDocuments)
9
+ ) ' PowerShell\PSReadLine\AllHosts_history.txt' )
10
+ # Can be toggled with F2.
11
+ Set-PSReadLineOption - PredictionViewStyle ListView
Original file line number Diff line number Diff line change @@ -51,8 +51,19 @@ function Get-SourceContent {
51
51
[ValidateNotNullOrEmpty ()]
52
52
[string ]$Path
53
53
)
54
- # TODO Support a config file (e.g. '.filelist') to determine order and inclusions/exclusions.
55
- [FileInfo []]$files = Get-ChildItem $Path - Filter ' *.ps1'
54
+ # '.files just lists all file names to include in the desired order.
55
+ [string ]$filelist = Join-Path $Path ' .files'
56
+ [FileInfo []]$files = $null
57
+ if (Test-Path $filelist - PathType Leaf) {
58
+ $files = Get-Content $filelist |
59
+ ForEach-Object { $_.Trim () } |
60
+ Where-Object { -not [string ]::IsNullOrEmpty($_ ) -and -not $_.StartsWith ([char ]' #' ) } |
61
+ ForEach-Object { Join-Path - Path $Path $_ } |
62
+ Get-Item
63
+ }
64
+ else {
65
+ $files = Get-ChildItem $Path - Filter ' *.ps1'
66
+ }
56
67
Write-Verbose ' Source Files:'
57
68
$files | Out-String | Write-Verbose
58
69
$files | Get-Content - Raw
You can’t perform that action at this time.
0 commit comments