# Cómo Listar y Gestionar Variables de Entorno en PowerShel

- Link: https://binariocero.com/windows/como-listar-y-gestionar-variables-de-entorno-en-powershel
- Published: 2025-05-27T17:27:17+02:00
- Author: Juan José Fernández Durán

![Loading](https://binariocero.com/wp-content/plugins/page-views-count/ajax-loader-
2x.gif)

Para listar las variables de entorno en PowerShell, puedes usar varias formas. Aquí
tienes las más comunes:

### 1. **Listar todas las variables de entorno**

    ```wp-block-preformatted
    Get-ChildItem Env:
    ```

O bien:

    ```wp-block-preformatted
    gci env:
    ```

### 2. **Filtrar por nombre específico**

Por ejemplo, si quieres ver solo la variable `PATH`:

    ```wp-block-preformatted
    $env:PATH
    ```

O con filtro:

    ```wp-block-preformatted
    Get-ChildItem Env: | Where-Object { $_.Name -like '*PATH*' }
    ```

### 3. **Exportar a archivo**

Para guardar la lista en un archivo de texto:

    ```wp-block-preformatted
    Get-ChildItem Env: | Out-File -FilePath .\variables_entorno.txt
    ```

### 4. **Convertir a objeto para manipulación**

Si quieres trabajar con ellas como un objeto:

    ```wp-block-preformatted
    $variables = Get-ChildItem Env:$variables | Format-Table -AutoSize
    ```
