feat: first commit from pwsh7 in my Linux

This commit is contained in:
Daniel Oscar Zamo 2026-03-16 12:53:53 +01:00
parent 0a6f271052
commit 4796df396a
3 changed files with 25 additions and 0 deletions

0
bash/my_functions.sh Normal file
View File

5
bash/my_notes.md Normal file
View File

@ -0,0 +1,5 @@
## SSH
### Tunel reverso
- `ssh -R `

View File

@ -0,0 +1,20 @@
# 1. Identificar el editor según el OS
$editor = if ($IsLinux) { "vim" } else { "notepad" }
# 2. Verificar y crear el perfil si no existe
if (!(Test-Path $PROFILE)) {
Write-Host "Creando perfil en: $PROFILE" -ForegroundColor Yellow
# Asegura que la carpeta contenedora exista (importante en Linux)
New-Item -Type Directory -Path (Split-Path $PROFILE) -ErrorAction SilentlyContinue
New-Item -Type File -Path $PROFILE -Force
} else {
Write-Host "El perfil ya existe en: $PROFILE" -ForegroundColor Green
}
# 3. Abrir el perfil con el editor correspondiente
# Usamos Start-Process en Windows o invocación directa en Linux
if ($IsLinux) {
& $editor $PROFILE
} else {
Start-Process $editor $PROFILE
}