14 lines
784 B
PowerShell
14 lines
784 B
PowerShell
$ErrorActionPreference = "Continue"
|
|
Write-Output "=== my.ini (no password lines expected) ==="
|
|
Get-Content "C:\yutongda\tools\mysql-8.0.39-winx64\my.ini" | ForEach-Object {
|
|
if ($_ -match 'password') { 'REDACTED' } else { $_ }
|
|
}
|
|
Write-Output "=== search mysql root/pass in ops/tools ==="
|
|
Get-ChildItem "C:\yutongda\ops","C:\yutongda\tools","C:\yutongda\incoming" -Recurse -Include *.ps1,*.cmd,*.bat,*.env,*.txt,*.md -EA SilentlyContinue -Depth 3 |
|
|
Select-String -Pattern "mysqld|mysql.*root|MYSQL_ROOT|--initialize" -EA SilentlyContinue |
|
|
Select-Object -First 40 @{n='F';e={$_.Filename}}, LineNumber, @{n='L';e={
|
|
$t=$_.Line.Trim()
|
|
if ($t -match 'password|passwd|pwd\s*=') { 'REDACTED' } else { $t.Substring(0,[Math]::Min(140,$t.Length)) }
|
|
}}
|
|
Write-Output "SEARCH_DONE"
|