MCPcopy Create free account
hub / github.com/ZToolsCenter/ZTools / escapePowerShellPath

Function escapePowerShellPath

tests/main/windowsExplorerCommands.test.ts:45–48  ·  view source on GitHub ↗

* 安全转义 PowerShell 路径参数

(folderPath: string)

Source from the content-addressed store, hash-verified

43 * 安全转义 PowerShell 路径参数
44 */
45function escapePowerShellPath(folderPath: string): string {
46 const escaped = folderPath.replace(/'/g, "''")
47 return `'${escaped}'`
48}
49
50/**
51 * 安全转义 CMD 路径参数

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected