Fix case-sensitive path lookup for Performance Toolkit sample app on Linux (#2246)
### ❔What, Why & How
The hardcoded path in `CreateApp.ps1` uses backslashes and a fixed
directory casing, which doesn't resolve correctly on Linux's
case-sensitive filesystem when creating performance test apps.
Replace the hardcoded `Join-Path` with a recursive file search that
first narrows scope to the `Applications` subdirectory:
```powershell
# Before (fails on Linux)
$sampleApp = Join-Path $folders[1] "Applications\testframework\performancetoolkit\Microsoft_Performance Toolkit Samples.app"
# After (cross-platform, avoids hardcoded directory casing)
$searchRoot = Get-ChildItem -Path $folders[1] -Directory -ErrorAction SilentlyContinue | Where-Object { $_.Name -ieq 'Applications' } | Select-Object -First 1 -ExpandProperty FullName
if (!$searchRoot) { $searchRoot = $folders[1] }
$sampleApp = Get-ChildItem -Path $searchRoot -Filter "Microsoft_Performance Toolkit Samples.app" -File -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName
```
Additional improvements:
- Added a null check on `$sampleApp` before `Test-Path` since
`Get-ChildItem` can return nothing.
- Added `-File` flag to restrict results to files only.
- Added `-ErrorAction SilentlyContinue` to prevent transient access
errors from failing the action under `$ErrorActionPreference = 'Stop'`.
- Narrowed the recursive search to the `Applications` subdirectory
(found case-insensitively via `-ieq`) to reduce IO, falling back to the
full artifact root if not found.
- Improved the error message to include the searched root path and
expected filename for easier CI debugging.
- Consolidated duplicate tests into a single parameterized test using
Pester `-TestCases`.
### ✅ Checklist
- [x] Add tests (E2E, unit tests)
- [x] Update RELEASENOTES.md
- [ ] Update documentation (e.g. for new settings or scenarios)
- [ ] Add telemetry
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> C
Copilot committed
17d656a4fde5f320c4496f80198ce5269f0e296e
Parent: ddd4b65
Committed by GitHub <noreply@github.com>
on 6/17/2026, 8:44:19 AM