Setup fixed setup of MyPSScriptRoot (again)
This commit is contained in:
parent
fe97c2880a
commit
ccaaadf371
|
@ -55,7 +55,10 @@ if( Get-Command Remove-Alias -ErrorAction SilentlyContinue ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $(. Get-ScopeDepth) -gt 0 ) { Write-Host -ForegroundColor Red "Try sourcing Reload-MyScripts instead of just running it" }
|
if( $(. Get-ScopeDepth) -gt 0 ) { Write-Host -ForegroundColor Red "Try sourcing Reload-MyScripts instead of just running it" }
|
||||||
Get-ChildItem $(Join-Path $MyPSScriptRoot profile.d) -Filter '*.ps1' | ForEach-Object { ". '$($_.FullName)';" } | Invoke-Expression
|
Get-ChildItem $(Join-Path $MyPSScriptRoot profile.d) -Filter '*.ps1' | ForEach-Object {
|
||||||
|
Write-Verbose "Loading $($_.FullName -replace '\.ps1$','' -replace "^$([regex]::Escape($MyPSScriptRoot)).",'')...";
|
||||||
|
". '$($_.FullName)';"
|
||||||
|
} | Invoke-Expression
|
||||||
|
|
||||||
$local:CommandsToAlias = (
|
$local:CommandsToAlias = (
|
||||||
@( $MyPSScriptRoot ) + $(
|
@( $MyPSScriptRoot ) + $(
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
[switch]$NoGitClone,
|
[switch]$NoGitClone,
|
||||||
[string]$GitURL = 'https://code.lksz.me/lksz/PowerShell_Scripts',
|
[string]$GitURL = 'https://code.lksz.me/lksz/PowerShell_Scripts',
|
||||||
[Parameter(DontShow)]
|
[Parameter(DontShow)]
|
||||||
[string]$MyPSScriptRoot = $MyPSScriptRoot
|
[string]$My_PSScriptRoot = $MyPSScriptRoot
|
||||||
)
|
)
|
||||||
|
|
||||||
function _Setup {
|
function _Setup {
|
||||||
|
@ -18,7 +18,7 @@ function _Setup {
|
||||||
[switch]$NoGitClone,
|
[switch]$NoGitClone,
|
||||||
[string]$GitURL = 'https://code.lksz.me/lksz/PowerShell_Scripts',
|
[string]$GitURL = 'https://code.lksz.me/lksz/PowerShell_Scripts',
|
||||||
[Parameter(DontShow)]
|
[Parameter(DontShow)]
|
||||||
[string]$MyPSScriptRoot = $MyPSScriptRoot)
|
[string]$My_PSScriptRoot = $MyPSScriptRoot)
|
||||||
|
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
@ -41,6 +41,7 @@ Get-Command Reload-MyScripts -ErrorAction SilentlyContinue | ForEach-Object { .
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
||||||
. ProfileCode_common
|
. ProfileCode_common
|
||||||
|
if( -not $MyPSScriptRoot ) { throw '$MyPSScriptRoot does NOT exist!' }
|
||||||
|
|
||||||
if ( -not $NoGitClone -and -not (Test-Path $(Join-Path $MyPSScriptRoot '.git')) ) {
|
if ( -not $NoGitClone -and -not (Test-Path $(Join-Path $MyPSScriptRoot '.git')) ) {
|
||||||
if ( -not [bool]$(Get-Command git -ErrorAction SilentlyContinue) ) {
|
if ( -not [bool]$(Get-Command git -ErrorAction SilentlyContinue) ) {
|
||||||
|
|
Loading…
Reference in New Issue