# gori-gorilla-gori/ps1_util architecture

> Architecture diagram of the GitHub repository gori-gorilla-gori/ps1_util, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gori-gorilla-gori/ps1_util
- Repository: https://github.com/gori-gorilla-gori/ps1_util

## Overview

1. **Repository type**
   - This is a small PowerShell utility collection, not a full application or service.
   - Everything runs locally from the PowerShell shell, with no backend, database, or web layer.

2. **Top-level structure**
   - `Add-Path.ps1`: a system-environment helper for PATH management.
   - `Get-LanClient.ps1`: a LAN discovery / reachability checker.
   - `Get-LanClient.ps1xml`: a PowerShell formatting file used to control how scan results are displayed.
   - `README.md` documents usage; `LICENSE` defines distribution terms.

3. **Subsystem: PATH management**
   - `Add-Path.ps1` accepts either the current folder or a specific directory via `-TargetDir`.
   - Its job is to update the Windows PATH environment so the chosen directory can be invoked from future shells.
   - The boundary here is the **OS environment**: it writes to environment state, but the README notes the current PowerShell session must be restarted for the change to take effect.

4. **Subsystem: LAN scanning**
   - `Get-LanClient.ps1` scans a configurable IP range and checks whether hosts are online.
   - Default behavior targets `192.168.1.1` through `192.168.1.255`, treating the third octet as the network prefix.
   - Parameters let the caller:
     - limit output to reachable hosts with `-OnlineOnly`,
     - change the network prefix with `-Network`,
     - change the scan window with `-Start` / `-End`.

5. **Data flow in the scanner**
   - Inputs are command-line parameters.
   - The script generates candidate IP addresses from the configured prefix/range.
   - Each address is probed to determine reachability.
   - Results are emitted as structured PowerShell objects and/or formatted console output.

6. **Formatting layer**
   - `Get-LanClient.ps1xml` is the presentation boundary for the LAN scanner.
   - In PowerShell terms, this likely defines a custom view so scan results appear in a readable table or labeled format rather than raw object properties.
   - Architecturally, this separates **data production** in the `.ps1` from **display formatting** in the `.ps1xml`.

7. **Execution/runtime model**
   - The repo depends on Windows PowerShell / PowerShell, the local network stack, and built-in OS environment-variable behavior.
   - There are no visible third-party dependencies or external APIs; all effects are local to the machine and LAN.

8. **Important boundaries for an architecture diagram**
   - **User shell** invokes the scripts.
   - `Add-Path.ps1` crosses into the **Windows environment configuration** boundary.
   - `Get-LanClient.ps1` crosses into the **network** boundary by probing LAN hosts.
   - `Get-LanClient.ps1xml` stays on the **presentation** side, shaping console output only.

9. **Overall shape**
   - The repository is best drawn as two independent utilities sharing the same PowerShell execution environment.
   - One utility changes local system configuration; the other inspects nearby network devices.
   - The only coupling between files is the scanner script and its associated formatting definition.

Main entry points: [`README.md`](https://github.com/gori-gorilla-gori/ps1_util/blob/main/README.md) (README), [`Get-LanClient.ps1`](https://github.com/gori-gorilla-gori/ps1_util/blob/main/Get-LanClient.ps1) (Get-LanClient), [`Add-Path.ps1`](https://github.com/gori-gorilla-gori/ps1_util/blob/main/Add-Path.ps1) (Add-Path), [`Get-LanClient.ps1xml`](https://github.com/gori-gorilla-gori/ps1_util/blob/main/Get-LanClient.ps1xml) (Scan view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_runtime["PowerShell runtime"]
  node_n_shell(("User shell<br/>runtime"))
  node_n_env[("OS env<br/>system boundary")]
  node_n_net[("LAN stack<br/>network boundary")]
end

subgraph group_grp_path["PATH utility"]
  node_n_addpath["Add-Path<br/>ps1 utility<br/>[Add-Path.ps1]"]
end

subgraph group_grp_lan["LAN scanner"]
  node_n_getlan["Get-LanClient<br/>ps1 scanner<br/>[Get-LanClient.ps1]"]
  node_n_format["Scan view<br/>ps1xml format"]
end

subgraph group_grp_docs["Repo docs"]
  node_n_readme["README<br/>docs<br/>[README.md]"]
  node_n_license["LICENSE"]
end

node_n_shell -->|"invoke"| node_n_addpath
node_n_shell -->|"invoke"| node_n_getlan
node_n_addpath -->|"update PATH"| node_n_env
node_n_getlan -->|"probe hosts"| node_n_net
node_n_getlan -->|"use view"| node_n_format
node_n_readme -.->|"document"| node_n_addpath
node_n_readme -.->|"document"| node_n_getlan
node_n_readme -.->|"document"| node_n_format
node_n_license -.->|"accompany"| node_n_readme

click node_n_addpath "https://github.com/gori-gorilla-gori/ps1_util/blob/main/Add-Path.ps1"
click node_n_getlan "https://github.com/gori-gorilla-gori/ps1_util/blob/main/Get-LanClient.ps1"
click node_n_format "https://github.com/gori-gorilla-gori/ps1_util/blob/main/Get-LanClient.ps1xml"
click node_n_readme "https://github.com/gori-gorilla-gori/ps1_util/blob/main/README.md"
click node_n_license "https://github.com/gori-gorilla-gori/ps1_util/tree/main/LICENSE"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_n_shell,node_n_env,node_n_net toneBlue
class node_n_addpath toneAmber
class node_n_getlan,node_n_format toneMint
class node_n_readme,node_n_license toneRose
```

## Components

### PowerShell runtime

Local shell execution environment and built-in OS/network capabilities used by the scripts.

- **User shell**: runtime · Local PowerShell session that invokes the utilities.
- **OS env**: system boundary · Windows environment-variable state affected by PATH changes.
- **LAN stack**: network boundary · Local network reachability used to probe hosts on the LAN.

### PATH utility

Script that updates the Windows PATH environment.

- [Add-Path](https://github.com/gori-gorilla-gori/ps1_util/blob/main/Add-Path.ps1): ps1 utility · Adds the current or specified directory to PATH. · `Add-Path.ps1`

### LAN scanner

Script that generates IPs, probes reachability, and formats scan output.

- [Get-LanClient](https://github.com/gori-gorilla-gori/ps1_util/blob/main/Get-LanClient.ps1): ps1 scanner · Scans an IP range and reports reachable LAN clients. · `Get-LanClient.ps1`
- [Scan view](https://github.com/gori-gorilla-gori/ps1_util/blob/main/Get-LanClient.ps1xml): ps1xml format · Custom formatting for LAN scan output. · `Get-LanClient.ps1xml`

### Repo docs

Documentation and licensing for the utility collection.

- [README](https://github.com/gori-gorilla-gori/ps1_util/blob/main/README.md): docs · Usage and behavior notes for the utilities. · `README.md`
- [LICENSE](https://github.com/gori-gorilla-gori/ps1_util/tree/main/LICENSE): license · Repository distribution terms. · `LICENSE`

## Connections

- User shell → Add-Path: invoke · User runs the PATH helper from PowerShell.
- User shell → Get-LanClient: invoke · User runs the LAN scanner from PowerShell.
- Add-Path → OS env: update PATH · Writes the chosen directory into the Windows PATH environment.
- Get-LanClient → LAN stack: probe hosts · Checks IP addresses for reachability on the local network.
- Get-LanClient → Scan view: use view · Scanner output is presented through the PowerShell formatting definition.
- README → Add-Path: document · Describes PATH helper usage and session restart requirement.
- README → Get-LanClient: document · Describes scan parameters, defaults, and output behavior.
- README → Scan view: document · Explains the separation between scan data and presentation.
- LICENSE → README: accompany · Repository terms accompany the documented utilities.
