Skip to content

Commit 6075162

Browse files
committed
update summary.ps1
1 parent 4bbc7c8 commit 6075162

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

summary.ps1

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,28 @@ $summaryFile = Join-Path -Path $folderPath -ChildPath "SUMMARY.md"
33

44
# 指定要排除的文件夹列表
55
$excludedFolders = @("images")
6-
76
# 指定要排除的文件类型
87
$excludedExtensions = @(".png", ".ps1")
9-
108
# 指定要排除的文件列表
119
$excludedFiles = @("SUMMARY.md")
1210

11+
#文件名称检查
12+
# 获取所有的文件
13+
Get-ChildItem -Path $folderPath -Recurse -File | ForEach-Object {
14+
$newname = $_.Name.Replace(" ", "") # 将文件名中的空格替换为空格
15+
if ($newname -ne $_.Name) { # 如果文件名发生了更改
16+
Rename-Item -Path $_.FullName -NewName $newname
17+
}
18+
}
19+
20+
# 获取所有的文件夹
21+
Get-ChildItem -Path $folderPath -Recurse -Directory | ForEach-Object {
22+
$newname = $_.Name.Replace(" ", "") # 将文件夹名中的空格替换为空格
23+
if ($newname -ne $_.Name) { # 如果文件夹名发生了更改
24+
Rename-Item -Path $_.FullName -NewName $newname
25+
}
26+
}
27+
1328
function GenerateSummary {
1429
param (
1530
[string]$path,

0 commit comments

Comments
 (0)