Merge branch 'master' of https://code.lksz.me/lksz/PowerShell_Scripts into master
This commit is contained in:
commit
bb23d940ea
|
@ -35,15 +35,6 @@ if( Test-Path $(Join-Path $MyPSScriptRoot Aliases) ) {
|
||||||
$myAliases[$_.BaseName] = Get-Content $_
|
$myAliases[$_.BaseName] = Get-Content $_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# $myAliases.sudo = 'Invoke-Sudo'
|
|
||||||
# $myAliases.vi = 'Edit-TextFile'
|
|
||||||
# $myAliases.vim = 'Edit-TextFile'
|
|
||||||
# $myAliases.nvim = 'Edit-TextFile'
|
|
||||||
# $myAliases.nvim = 'Edit-TextFile'
|
|
||||||
# $myAliases.l = 'ls.ps1'
|
|
||||||
# $myAliases.ll = 'ls.ps1'
|
|
||||||
|
|
||||||
#######################################################################
|
|
||||||
|
|
||||||
$local:IsVerbose = [bool]($PSBoundParameters['Verbose'])
|
$local:IsVerbose = [bool]($PSBoundParameters['Verbose'])
|
||||||
|
|
||||||
|
|
|
@ -380,10 +380,10 @@ param([string]$EnvPath)
|
||||||
|
|
||||||
# Establish Module Path
|
# Establish Module Path
|
||||||
$global:MyPSModulePath = Split-PathEnv $env:PSModulePath |
|
$global:MyPSModulePath = Split-PathEnv $env:PSModulePath |
|
||||||
Where-Object { $_ -match "^$($(Resolve-Path ~) -replace '\\',"\\")" } |
|
Where-Object { $_ -match "^$($(Resolve-Path ~) -replace '\\',"\\")" } |
|
||||||
Where-Object { Test-Path $_ } |
|
Where-Object { Test-Path $_ } |
|
||||||
Get-Item | Sort-Object -Property LastWriteTime -Descending |
|
Get-Item | Sort-Object -Property LastWriteTime -Descending |
|
||||||
Select-Object -ExpandProperty FullName -First 1
|
Select-Object -ExpandProperty FullName -First 1
|
||||||
|
|
||||||
if ( -not $MyPSModulePath ) {
|
if ( -not $MyPSModulePath ) {
|
||||||
$MyPSModulePath = $(Join-Path $(Join-Path $(Resolve-Path ~) 'powershell') 'Modules')
|
$MyPSModulePath = $(Join-Path $(Join-Path $(Resolve-Path ~) 'powershell') 'Modules')
|
||||||
|
@ -409,10 +409,14 @@ $p = @($p[0], $MyPSScriptRoot) + $($p | Select-Object -Skip 1)
|
||||||
$env:PATH = $p -join $PathEnvDelimiter
|
$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) ) {
|
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..."
|
Write-Verbose "Calling ProfileCode inline..."
|
||||||
. ProfileCode_common
|
$importExpression = "ProfileCode_common"
|
||||||
}
|
}
|
||||||
|
. Invoke-Expression $importExpression
|
||||||
|
|
||||||
|
$SetupFromWeb = [bool]$(@( $SetupFromWeb, $sfw, $LoadCode ) | Where-Object { $_ })
|
||||||
|
|
||||||
if ( -not $SetupFromWeb ) {
|
if ( -not $SetupFromWeb ) {
|
||||||
_setup @PSBoundParameters
|
_setup @PSBoundParameters
|
||||||
|
|
Loading…
Reference in New Issue