Introduction of BitWarden package + prep

+ BitWarden module for easy autologon (not very secure but convinent on
  personal machines) - Will think this over some more afterwards
* Get-Path will always return without trailing directory separator
  (might want to make this 'always' for dirs, but unsure yet)
+ Added Edit-MountUnit scaffolding for later modifying it to import a
  template on new mount units, and easy edit of systemd mount and
  automount units.
This commit is contained in:
Gal on Sygin 2022-02-03 19:08:16 -05:00
parent 40cb17d419
commit c0131deba4
7 changed files with 64 additions and 21 deletions

View file

@ -5,17 +5,6 @@
[string[]]$Path
)
process {
function Get-FullPath {
param([string]$Path)
if([System.IO.Path]::IsPathRooted($Path)){
[System.IO.Path]::GetFullPath($Path)
}else{
[System.IO.Path]::GetFullPath((Join-Path $PWD $Path))
}
}
foreach( $local:p in $Path ) {
switch( $p[0] ) {
'@' { $p = Join-Path $MyPSScriptRoot $p.Substring(1) }
@ -27,6 +16,9 @@ process {
}
}
# clean end of path from DirectorySeparatorChars
$p = $p -replace '[/\\]+$',''
$p = $p -replace '#C-','#C-#' -replace '\*','#C-A#' -replace '\?','#C-Q#'
if([System.IO.Path]::IsPathRooted($p)){
$p = [System.IO.Path]::GetFullPath($p)
@ -44,9 +36,3 @@ process {
$p
}
}
# try {
# get-item $Path -Force -ErrorAction Stop |
# Select-Object -ExpandProperty FullName
# } catch {
# $_.targetObject
# }