docs: remove duplicate summary, expand FAQ to 5 items#19
Conversation
443040e to
0d9beb5
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the Windows Terminal + PowerShell 7 setup post to address a reported SHA256 verification mismatch in the embedded PowerShell script, expands the FAQ with additional troubleshooting notes, and removes a duplicated summary block near the end of the post.
Changes:
- Adjust SHA256 comparison lines in the script to normalize the expected hash value with
.ToUpper(). - Add FAQ entries explaining why PS 5.1 may still appear on first launch and where to find updated SHA256 values for upgrades.
- Remove a duplicated summary block after the changelog.
Comments suppressed due to low confidence (1)
content/posts/win-terminal-setup.md:72
- 这里对
$wtZipHash调用.ToUpper()目前是冗余的(变量本身已是大写),且与前述一样:-ne默认不区分大小写,所以这行改动基本不影响行为。为了避免重复/不一致,建议用显式-ine(或统一对两侧做同样的规范化),并同步更新文内代理版脚本里同样的 SHA256 比较逻辑。
$wtZipHash = "8FB268B93C9B99D6CF553709C2C58BF1B2FF4B364199152E09221DFB2A44BBF5"
if ((Get-FileHash $wtZip -Algorithm SHA256).Hash -ne $wtZipHash.ToUpper()) {
throw "Windows Terminal zip SHA256 校验失败"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Invoke-WebRequest -Uri $ps7Url -OutFile $ps7Out -UseBasicParsing -ErrorAction Stop -TimeoutSec 300 | ||
| $ps7Hash = "ed331a04679b83d4c013705282d1f3f8d8300485eb04c081f36e11eaf1148bd0" | ||
| if ((Get-FileHash $ps7Out -Algorithm SHA256).Hash -ne $ps7Hash) { | ||
| if ((Get-FileHash $ps7Out -Algorithm SHA256).Hash -ne $ps7Hash.ToUpper()) { |
Note: SHA256 case comparison was reverted after review — PowerShell -ne is case-insensitive by default, so the original script did not have a case-sensitivity bug. Changes: - Remove duplicate summary block after changelog - Add Q4: first launch still shows PS5.1 (needs restart) - Add Q5: where to find new SHA256 hashes on GitHub Release pages - Update changelog: FAQ count from 3 to 5
0d9beb5 to
552251c
Compare
|
Closing: the SHA256 case-sensitivity concern was a false positive (PowerShell -ne is case-insensitive by default). Other doc tweaks (FAQ expansion, duplicate summary removal) are minor and can be handled separately if needed. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 552251cfac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -296,7 +308,7 @@ if (Test-Path $ps7Out) { Remove-Item $ps7Out -Force } | |||
| Write-Host ">>> 下载 PowerShell $ps7Ver..." -ForegroundColor Cyan | |||
There was a problem hiding this comment.
Apply the SHA case fix to the primary script too
This fixes the proxy copy, but the main “一键脚本” earlier in the article still defines the same lowercase $ps7Hash and compares it directly with Get-FileHash at lines 46-47. Anyone following the default script instead of the proxy appendix will still hit the uppercase-vs-lowercase mismatch and throw before installing PowerShell, so the documented primary path remains broken.
Useful? React with 👍 / 👎.
fix: SHA256 case bug + FAQ expansion
PowerShell Get-FileHash returns uppercase SHA256, but PS7 hash was lowercase. Direct -ne comparison always fails.
Changes: