How gori-gorilla-gori/ps1_util works
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 README · Get-LanClient.ps1 Get-LanClient · Add-Path.ps1 Add-Path · Get-LanClient.ps1xml Scan view
Components 8
PowerShell runtime
Local shell execution environment and built-in OS/network capabilities used by the scripts.
- User shell · Local PowerShell session that invokes the utilities.
- OS env · Windows environment-variable state affected by PATH changes.
- LAN stack · Local network reachability used to probe hosts on the LAN.
PATH utility
Script that updates the Windows PATH environment.
- Add-Path · 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 · Scans an IP range and reports reachable LAN clients.
Get-LanClient.ps1 - Scan view · Custom formatting for LAN scan output.
Get-LanClient.ps1xml
Connections 9
- 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.