Fix some ps1 issues#8
Merged
Merged
Conversation
This was referenced May 17, 2026
lc2panda
added a commit
that referenced
this pull request
May 17, 2026
PR #8 (quickquickcode) 合并修复 PowerShell 字符串插值致命bug时 意外引入 UTF-8 BOM (ef bb bf) 到 wps-com.ps1 首行。 BOM 在部分 powershell -File 解释器/CI 环境会破坏脚本运行, 按香草上校审查团队风险评估清单跟进清理。 验证: - npm run build ✅ - npm test ✅ 101/101 全通过 - diff: 仅首行 -# → +# (1 byte 变化)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a set of PowerShell string interpolation issues in
wps-office-mcp/scripts/wps-com.ps1that affect Excel range expressions involving row and column references.The main change is replacing patterns like:
"$col:$col""$startRow:$endRow"with explicit variable boundaries such as:
"${col}:${col}""${startRow}:${endRow}"This avoids ambiguous parsing when a variable is immediately followed by
:in a double-quoted string.Why
In PowerShell, variable interpolation can become error-prone when variable names are directly adjacent to characters like
:. Using${...}makes the intended variable boundaries explicit and ensures the generated range string is correct.This is especially important for COM calls like:
Range(...).ColumnWidth = ...Range(...).AutoFit()Range(...).Insert()Range(...).Delete()Range(...).Hidden = $true / $falseRange(...).Group()Scope of changes
Updated Excel-related range construction in the following operations inside
wps-com.ps1:Impact
This change should improve reliability for Excel row/column range operations in the WPS COM bridge and prevent malformed range strings caused by ambiguous interpolation.
Notes
956c29106abbe3503f57e8a311ee23566488059f