(name: string)
| 1015 | * semantically this is "alters path-resolution namespace". |
| 1016 | */ |
| 1017 | export function isCwdChangingCmdlet(name: string): boolean { |
| 1018 | const canonical = resolveToCanonical(name) |
| 1019 | return ( |
| 1020 | canonical === 'set-location' || |
| 1021 | canonical === 'push-location' || |
| 1022 | canonical === 'pop-location' || |
| 1023 | // New-PSDrive creates a drive mapping that redirects <name>:/... paths |
| 1024 | // to an arbitrary filesystem root. Aliases ndr/mount are not in |
| 1025 | // COMMON_ALIASES — check them explicitly (finding #21). |
| 1026 | canonical === 'new-psdrive' || |
| 1027 | // ndr/mount are PS aliases for New-PSDrive on Windows only. On POSIX, |
| 1028 | // 'mount' is the native mount(8) command; treating it as PSDrive-creating |
| 1029 | // would false-positive. (bug #15 / review nit) |
| 1030 | (getPlatform() === 'windows' && |
| 1031 | (canonical === 'ndr' || canonical === 'mount')) |
| 1032 | ) |
| 1033 | } |
| 1034 | |
| 1035 | /** |
| 1036 | * Checks if a command name (after alias resolution) is a safe output cmdlet. |
no test coverage detected