Skip to content

Commit 891d6cd

Browse files
Copilotanupriya13
andcommitted
Fix PATH refresh for ASA tool to be recognized in PowerShell
Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com>
1 parent f597b91 commit 891d6cd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.ado/jobs/attack-surface-analyzer.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ jobs:
5656
# Install from public NuGet.org feed
5757
dotnet tool install --global Microsoft.CST.AttackSurfaceAnalyzer.CLI --add-source https://api.nuget.org/v3/index.json
5858
59+
# Refresh environment PATH to include .NET global tools
60+
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH", "User")
61+
5962
# Verify installation
6063
asa --version
6164
if ($LASTEXITCODE -ne 0) {
@@ -70,6 +73,9 @@ jobs:
7073
inputs:
7174
targetType: inline
7275
script: |
76+
# Refresh environment PATH to include .NET global tools
77+
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH", "User")
78+
7379
Write-Host "Taking 'before' snapshot of system state..."
7480
asa collect -r before --verbose
7581
if ($LASTEXITCODE -ne 0) {
@@ -105,6 +111,9 @@ jobs:
105111
inputs:
106112
targetType: inline
107113
script: |
114+
# Refresh environment PATH to include .NET global tools
115+
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH", "User")
116+
108117
Write-Host "Taking 'after' snapshot of system state..."
109118
asa collect -r after --verbose
110119
if ($LASTEXITCODE -ne 0) {
@@ -119,6 +128,9 @@ jobs:
119128
inputs:
120129
targetType: inline
121130
script: |
131+
# Refresh environment PATH to include .NET global tools
132+
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH", "User")
133+
122134
Write-Host "Comparing before and after snapshots..."
123135
124136
# Create output directory for results

0 commit comments

Comments
 (0)