Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Tasks/AzurePowerShellV5/azurepowershell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ async function run() {

const env = process.env;
const hostEnv = `ADO/AzurePowerShell@v5_${env.AGENT_OS || ""}_${env.AGENT_NAME || ""}_${env.BUILD_DEFINITIONNAME || ""}_${env.BUILD_BUILDID || ""}_${env.RELEASE_DEFINITIONNAME || ""}_${env.RELEASE_RELEASEID || ""}`;

process.env.AZUREPS_HOST_ENVIRONMENT = hostEnv;
console.log(`AZUREPS_HOST_ENVIRONMENT: ${hostEnv}`);
console.log(`AZUREPS_HOST_ENVIRONMENT: ${hostEnv}`);

try {
tl.setResourcePath(path.join(__dirname, 'task.json'));
Expand All @@ -37,6 +37,7 @@ async function run() {
throw new Error(tl.loc('JS_InvalidErrorActionPreference', _vsts_input_errorActionPreference));
}


let scriptType: string = tl.getInput('ScriptType', /*required*/true);
let scriptPath = convertToNullIfUndefined(tl.getPathInput('ScriptPath', false));
let scriptInline: string = convertToNullIfUndefined(tl.getInput('Inline', false));
Expand Down Expand Up @@ -207,7 +208,7 @@ async function run() {
async function getInstalledAzModuleVersion(): Promise<string | null> {
try {
tl.debug('Checking installed Az PowerShell module version...');

// PowerShell command to get the installed Az module version
const powershell = tl.tool(tl.which('pwsh') || tl.which('powershell') || tl.which('pwsh', true))
.arg('-NoLogo')
Expand All @@ -217,7 +218,7 @@ async function getInstalledAzModuleVersion(): Promise<string | null> {
.arg('Unrestricted')
.arg('-Command')
.arg(`. '${path.join(path.resolve(__dirname),'Utility.ps1')}'; Get-InstalledMajorRelease -moduleName 'Az' -iswin $false`);

const result = await powershell.execSync()
if (result.code === 0 && result.stdout) {
const version = result.stdout.trim();
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV5/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 5,
"Minor": 260,
"Minor": 261,
"Patch": 0
},
"releaseNotes": "Added support for Az Module and cross platform agents.",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV5/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 5,
"Minor": 260,
"Minor": 261,
"Patch": 0
},
"releaseNotes": "ms-resource:loc.releaseNotes",
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"@types/adm-zip": "^0.4.34",
"@types/minimatch": "^3.0.2",
"@types/minimist": "^1.2.5",
"@types/node": "^20.19.9",
"@types/semver": "^5.5.0",
"@types/shelljs": "^0.8.17",
"@types/validator": "^13.15.2",
Expand Down