From 4796df396a5444a70fd1d1cd1c1a62929a471e24 Mon Sep 17 00:00:00 2001 From: Daniel Oscar Zamo Date: Mon, 16 Mar 2026 12:53:53 +0100 Subject: [PATCH] feat: first commit from pwsh7 in my Linux --- bash/my_functions.sh | 0 bash/my_notes.md | 5 +++++ pwsh7/My/Check_ProwerShell_profile.ps1 | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 bash/my_functions.sh create mode 100644 bash/my_notes.md create mode 100644 pwsh7/My/Check_ProwerShell_profile.ps1 diff --git a/bash/my_functions.sh b/bash/my_functions.sh new file mode 100644 index 0000000..e69de29 diff --git a/bash/my_notes.md b/bash/my_notes.md new file mode 100644 index 0000000..db82ff0 --- /dev/null +++ b/bash/my_notes.md @@ -0,0 +1,5 @@ +## SSH + +### Tunel reverso + +- `ssh -R ` diff --git a/pwsh7/My/Check_ProwerShell_profile.ps1 b/pwsh7/My/Check_ProwerShell_profile.ps1 new file mode 100644 index 0000000..8b6b0e8 --- /dev/null +++ b/pwsh7/My/Check_ProwerShell_profile.ps1 @@ -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 +}