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

Method isHostedAgent

lib/index.js:8541–8555  ·  view source on GitHub ↗
(moduleContainerPath)

Source from the content-addressed store, hash-verified

8539 return !!version.match(Constants_1.default.versionPattern);
8540 }
8541 static isHostedAgent(moduleContainerPath) {
8542 return __awaiter(this, void 0, void 0, function* () {
8543 const script = `Test-Path (Join-Path "${moduleContainerPath}" "az_*")`;
8544 let output = "";
8545 const options = {
8546 listeners: {
8547 stdout: (data) => {
8548 output += data.toString();
8549 }
8550 }
8551 };
8552 yield PowerShellToolRunner_1.default.executePowerShellCommand(script, options);
8553 return output.trim().toLowerCase() === "true";
8554 });
8555 }
8556 static isGhes() {
8557 const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
8558 return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';

Callers 2

installMethod · 0.45
Utils.test.tsFile · 0.45

Calls 2

toStringMethod · 0.80

Tested by

no test coverage detected