mirror of
https://github.com/cmderdev/cmder.git
synced 2025-01-10 16:29:08 +08:00
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:
parent
2e9b512102
commit
e1bf703f50
8
vendor/profile.ps1
vendored
8
vendor/profile.ps1
vendored
@ -123,11 +123,11 @@ if (-not (Test-Path -PathType container "$ENV:CMDER_ROOT\config\profile.d")) {
|
|||||||
|
|
||||||
Push-Location $ENV:CMDER_ROOT\config\profile.d
|
Push-Location $ENV:CMDER_ROOT\config\profile.d
|
||||||
foreach ($x in Get-ChildItem *.psm1) {
|
foreach ($x in Get-ChildItem *.psm1) {
|
||||||
Write-Verbose Write-Host Sourcing $x
|
Write-Verbose "Sourcing $x"
|
||||||
Import-Module $x
|
Import-Module $x
|
||||||
}
|
}
|
||||||
foreach ($x in Get-ChildItem *.ps1) {
|
foreach ($x in Get-ChildItem *.ps1) {
|
||||||
Write-Verbose Write-Host Sourcing $x
|
Write-Verbose "Sourcing $x"
|
||||||
. $x
|
. $x
|
||||||
}
|
}
|
||||||
Pop-Location
|
Pop-Location
|
||||||
@ -137,11 +137,11 @@ Pop-Location
|
|||||||
if ($ENV:CMDER_USER_CONFIG -ne "" -and (Test-Path "$ENV:CMDER_USER_CONFIG\profile.d")) {
|
if ($ENV:CMDER_USER_CONFIG -ne "" -and (Test-Path "$ENV:CMDER_USER_CONFIG\profile.d")) {
|
||||||
Push-Location $ENV:CMDER_USER_CONFIG\profile.d
|
Push-Location $ENV:CMDER_USER_CONFIG\profile.d
|
||||||
foreach ($x in Get-ChildItem *.psm1) {
|
foreach ($x in Get-ChildItem *.psm1) {
|
||||||
Write-Verbose Write-Host Sourcing $x
|
Write-Verbose "Sourcing $x"
|
||||||
Import-Module $x
|
Import-Module $x
|
||||||
}
|
}
|
||||||
foreach ($x in Get-ChildItem *.ps1) {
|
foreach ($x in Get-ChildItem *.ps1) {
|
||||||
Write-Verbose Write-Host Sourcing $x
|
Write-Verbose "Sourcing $x"
|
||||||
. $x
|
. $x
|
||||||
}
|
}
|
||||||
Pop-Location
|
Pop-Location
|
||||||
|
Loading…
Reference in New Issue
Block a user