-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddmarker.ps1
More file actions
31 lines (22 loc) · 1.03 KB
/
addmarker.ps1
File metadata and controls
31 lines (22 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -------------------------------------------------------------------
# File: Add-OneClikMarker.ps1
# Description: Adds a standard OneClik project marker comment to the
# top of every .ps1 and .psd1 file under the src tree.
# Author: Benjamin J. Baker
# Created: 2026-02-22
# -------------------------------------------------------------------
$Root = "C:\Users\benja\source\repos\OneClik\src"
$Marker = "# This file is a component of the OneClik project"
# Get all .ps1 and .psd1 files
$files = Get-ChildItem -Path $Root -Recurse -Include *.ps1, *.psd1
foreach ($file in $files) {
$content = Get-Content $file.FullName -Raw
if ($content -match [regex]::Escape($Marker)) {
Write-Host "Exists: $($file.FullName)" -ForegroundColor DarkGray
continue
}
$newContent = $Marker + "`r`n" + $content
Set-Content -Path $file.FullName -Value $newContent -Encoding UTF8
Write-Host "Updated: $($file.FullName)" -ForegroundColor Green
}
Write-Host "OneClik markers applied to all files." -ForegroundColor Cyan