mirror of
https://github.com/azure/login.git
synced 2026-03-13 18:17:09 -04:00
* Added unit tests for Azure PowerShell * Added unit tests * changes in utils * removed babel * changed variable name of enable-PSSession * refactor * added ci.yml * changes in utils test
16 lines
491 B
TypeScript
16 lines
491 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)
|
|
}
|
|
} |