A module newer than Windows PowerShell's own, whose one command fails.
(name: string, command: string, message: string)
| 163 | |
| 164 | /** A module newer than Windows PowerShell's own, whose one command fails. */ |
| 165 | function standIn(name: string, command: string, message: string): void { |
| 166 | const at = path.join(shadow, name, '99.0.0'); |
| 167 | fs.mkdirSync(at, { recursive: true }); |
| 168 | fs.writeFileSync(path.join(at, `${name}.psm1`), `function ${command} { throw ${psq(message)} }\nExport-ModuleMember -Function ${command}\n`); |
| 169 | fs.writeFileSync( |
| 170 | path.join(at, `${name}.psd1`), |
| 171 | `@{ RootModule = '${name}.psm1'; ModuleVersion = '99.0.0'; GUID = 'b2f1c0de-0000-4000-8000-000000000002'; FunctionsToExport = @('${command}') }\n`, |
| 172 | ); |
| 173 | } |
| 174 | |
| 175 | beforeAll(async () => { |
| 176 | dir = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-psmodulepath-')); |
no test coverage detected