fixed scoping issue

This commit is contained in:
Gal Szkolnik 2020-10-01 18:16:54 -04:00
부모 0718bf28c7
커밋 a782d09b2c
1개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제

파일 보기

@ -380,10 +380,10 @@ param([string]$EnvPath)
# Establish Module Path
$global:MyPSModulePath = Split-PathEnv $env:PSModulePath |
Where-Object { $_ -match "^$($(Resolve-Path ~) -replace '\\',"\\")" } |
Where-Object { Test-Path $_ } |
Get-Item | Sort-Object -Property LastWriteTime -Descending |
Select-Object -ExpandProperty FullName -First 1
Where-Object { $_ -match "^$($(Resolve-Path ~) -replace '\\',"\\")" } |
Where-Object { Test-Path $_ } |
Get-Item | Sort-Object -Property LastWriteTime -Descending |
Select-Object -ExpandProperty FullName -First 1
if ( -not $MyPSModulePath ) {
$MyPSModulePath = $(Join-Path $(Join-Path $(Resolve-Path ~) 'powershell') 'Modules')
@ -409,10 +409,12 @@ $p = @($p[0], $MyPSScriptRoot) + $($p | Select-Object -Skip 1)
$env:PATH = $p -join $PathEnvDelimiter
}
$local:importExpression = ""
if ( -not $MyPSScriptRoot -or (Test-Path function:Test-IsAdmin, function:ConvertTo-Base64, function:Invoke-ExpressionEx, function:Get-PowerShellPath, function:Export-FunctionSource | Where-Object { -not $_ } | Measure-Object | Select-Object -ExpandProperty Count) ) {
Write-Verbose "Calling ProfileCode inline..."
. ProfileCode_common
$importExpression = "ProfileCode_common"
}
. Invoke-Expression $importExpression
$SetupFromWeb = [bool]$(@( $SetupFromWeb, $sfw, $LoadCode ) | Where-Object { $_ })