20 lines
838 B
PowerShell
20 lines
838 B
PowerShell
$files = Get-ChildItem -Path C:\DBAdmin\brain -Recurse -Filter *.md
|
|
foreach ($file in $files) {
|
|
$content = Get-Content -Path $file.FullName -Raw
|
|
$newContent = $content -creplace 'llm-wiki', 'llm-knowledge'
|
|
$newContent = $newContent -creplace 'rag-vs-wiki', 'rag-vs-knowledge'
|
|
$newContent = $newContent -creplace 'wiki/', 'knowledge/'
|
|
$newContent = $newContent -creplace 'Wiki', 'Knowledge Base'
|
|
$newContent = $newContent -creplace 'wiki', 'knowledge'
|
|
|
|
if ($content -cne $newContent) {
|
|
Set-Content -Path $file.FullName -Value $newContent
|
|
}
|
|
}
|
|
|
|
$filesToRename = Get-ChildItem -Path C:\DBAdmin\brain -Recurse | Where-Object { $_.Name -match 'wiki' }
|
|
foreach ($file in $filesToRename) {
|
|
$newName = $file.Name -replace 'wiki', 'knowledge'
|
|
Rename-Item -Path $file.FullName -NewName $newName
|
|
}
|