diff --git a/src/powershell-extended/dotfiles/.config/powershell/Microsoft.PowerShell_profile.ps1 b/src/powershell-extended/dotfiles/.config/powershell/Microsoft.PowerShell_profile.ps1 index c2fab5a..0888f00 100644 --- a/src/powershell-extended/dotfiles/.config/powershell/Microsoft.PowerShell_profile.ps1 +++ b/src/powershell-extended/dotfiles/.config/powershell/Microsoft.PowerShell_profile.ps1 @@ -67,8 +67,10 @@ try { # $__PSProfileDirectoryPath = [System.IO.Path]::ChangeExtension($MyInvocation.MyCommand.Path, 'd') if ([System.IO.Directory]::Exists($__PSProfileDirectoryPath)) { - foreach ($file in [System.Array]::Sort( [System.IO.Directory]::GetFiles($__PSProfileDirectoryPath, '*.ps1') )) { - . $file + $__PSProfileCustomProfileFiles = [System.IO.Directory]::GetFiles($__PSProfileDirectoryPath, '*.ps1') + [System.Array]::Sort($__PSProfileCustomProfileFiles) + foreach ($__PSProfileCustomProfileFile in $__PSProfileCustomProfileFiles) { + . $__PSProfileCustomProfileFile } } #endregion Custom Profile -------------------------------------------------- diff --git a/src/powershell-extended/dotfiles/.config/powershell/Microsoft.VSCode_profile.ps1 b/src/powershell-extended/dotfiles/.config/powershell/Microsoft.VSCode_profile.ps1 index eaf1f32..4a51f08 100644 --- a/src/powershell-extended/dotfiles/.config/powershell/Microsoft.VSCode_profile.ps1 +++ b/src/powershell-extended/dotfiles/.config/powershell/Microsoft.VSCode_profile.ps1 @@ -75,10 +75,12 @@ try { # To load your own custom profile, you may create a directory named 'Microsoft.VSCode_profile.d' in the same directory as this file. # Then, place your custom profile files in the 'Microsoft.VSCode_profile.d' directory to load them automatically. # - $__PSProfileDirectoryPath = [System.IO.Path]::ChangeExtension($MyInvocation.MyCommand.Path, '.d') + $__PSProfileDirectoryPath = [System.IO.Path]::ChangeExtension($MyInvocation.MyCommand.Path, 'd') if ([System.IO.Directory]::Exists($__PSProfileDirectoryPath)) { - foreach ($file in [System.Array]::Sort( [System.IO.Directory]::GetFiles($__PSProfileDirectoryPath, '*.ps1') )) { - . $file + $__PSProfileCustomProfileFiles = [System.IO.Directory]::GetFiles($__PSProfileDirectoryPath, '*.ps1') + [System.Array]::Sort($__PSProfileCustomProfileFiles) + foreach ($__PSProfileCustomProfileFile in $__PSProfileCustomProfileFiles) { + . $__PSProfileCustomProfileFile } } #endregion Custom Profile --------------------------------------------------