Fix error from profile.d PowerShell scripts

When there are `ps1` files in `profile.d`, the following error is logged:

>A positional parameter cannot be found that accepts argument 'Sourcing'.
This commit is contained in:
Brian Dukes 2022-12-20 10:50:44 -06:00 committed by GitHub
parent 2e9b512102
commit e1bf703f50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

8
vendor/profile.ps1 vendored
View File

@ -123,11 +123,11 @@ if (-not (Test-Path -PathType container "$ENV:CMDER_ROOT\config\profile.d")) {
Push-Location $ENV:CMDER_ROOT\config\profile.d
foreach ($x in Get-ChildItem *.psm1) {
Write-Verbose Write-Host Sourcing $x
Write-Verbose "Sourcing $x"
Import-Module $x
}
foreach ($x in Get-ChildItem *.ps1) {
Write-Verbose Write-Host Sourcing $x
Write-Verbose "Sourcing $x"
. $x
}
Pop-Location
@ -137,11 +137,11 @@ Pop-Location
if ($ENV:CMDER_USER_CONFIG -ne "" -and (Test-Path "$ENV:CMDER_USER_CONFIG\profile.d")) {
Push-Location $ENV:CMDER_USER_CONFIG\profile.d
foreach ($x in Get-ChildItem *.psm1) {
Write-Verbose Write-Host Sourcing $x
Write-Verbose "Sourcing $x"
Import-Module $x
}
foreach ($x in Get-ChildItem *.ps1) {
Write-Verbose Write-Host Sourcing $x
Write-Verbose "Sourcing $x"
. $x
}
Pop-Location