MCPcopy Create free account
hub / github.com/Azure/powershell / createScriptFile

Method createScriptFile

src/Utilities/FileUtils.ts:10–15  ·  view source on GitHub ↗
(inlineScript: string)

Source from the content-addressed store, hash-verified

8 static readonly tempDirectory: string = process.env.RUNNER_TEMP || os.tmpdir();
9
10 static async createScriptFile(inlineScript: string): Promise<string> {
11 const fileName: string = FileUtils.getFileName();
12 const filePath: string = path.join(FileUtils.tempDirectory, fileName);
13 fs.writeFileSync(filePath, inlineScript, 'utf-8');
14 return filePath;
15 }
16
17 private static getFileName(): string {
18 return `${uuidv4()}.ps1`;

Callers 1

executeFileMethod · 0.45

Calls 1

getFileNameMethod · 0.45

Tested by

no test coverage detected