$files = Get-ChildItem -Recurse -Filter '*.vue' 'D:\his\healthlink-his-ui\src' $allPerms = @() foreach ($f in $files) { $content = [System.IO.File]::ReadAllText($f.FullName, [System.Text.Encoding]::UTF8) if ($content -match 'v-hasPermi') { $lines = $content -split "`n" foreach ($line in $lines) { $matches2 = [regex]::Matches($line, "v-hasPermi.*?\['([^']+)'\]") foreach ($m in $matches2) { $allPerms += $m.Groups[1].Value } } } } $allPerms | Sort-Object -Unique