diff --git a/base/Get-Path.ps1 b/base/Get-Path.ps1 index 08e3bea..8c2536a 100644 --- a/base/Get-Path.ps1 +++ b/base/Get-Path.ps1 @@ -27,17 +27,19 @@ process { } } + $p = $p -replace '#C-','#C-#' -replace '\*','#C-A#' -replace '\?','#C-Q#' if([System.IO.Path]::IsPathRooted($p)){ $p = [System.IO.Path]::GetFullPath($p) }else{ $p = [System.IO.Path]::GetFullPath((Join-Path $PWD $p)) } + $p = $p -replace '#C-A#','*' -replace '#C-Q#','?' -replace '#C-#','#C-' if( $Expand ) { $p = $p | ForEach-Object { if( Test-Path $p ) { $p | Get-Item -Force | Select-Object -ExpandProperty FullName - } else { + } elseif( -not $Expand ) { $p } } diff --git a/base/profile.d/Join-String.ps1 b/base/profile.d/Join-String.ps1 new file mode 100644 index 0000000..2716a0f --- /dev/null +++ b/base/profile.d/Join-String.ps1 @@ -0,0 +1,12 @@ +if( -not (Get-Command Join-String -ErrorAction SilentlyContinue) ) { + if( -not (Get-Module -ListAvailable -Name "string") ) { + Write-Warning 'Join-String Command is missing, attempting to install stirng module' + $local:moduleScope = "CurrentUser" + if( Test-IsAdmin ) { $moduleScope = "AllUsers" } + Install-Module -Name "string" -Scope $moduleScope -AllowClobber -ErrorAction SilentlyContinue + } + if( -not (Get-Module -ListAvailable -Name "string") ) { + Write-Error "Failed to locate/install the module 'string'" + } + Import-Module -Name "string" -Cmdlet "Join-String" +} \ No newline at end of file