mirror of
https://github.com/azure/login.git
synced 2026-03-15 09:20:56 -04:00
16 lines
493 B
TypeScript
16 lines
493 B
TypeScript
import * as io from '@actions/io';
|
|
import * as exec from '@actions/exec';
|
|
|
|
export default class PowerShellToolRunner {
|
|
static psPath: string;
|
|
|
|
static async init() {
|
|
if(!PowerShellToolRunner.psPath) {
|
|
PowerShellToolRunner.psPath = await io.which("pwsh", true);
|
|
}
|
|
}
|
|
|
|
static async executePowerShellScriptBlock(scriptBlock: string, options: any = {}) {
|
|
await exec.exec(`"${PowerShellToolRunner.psPath}" -Command`, [scriptBlock], options)
|
|
}
|
|
} |