File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,14 +89,19 @@ $StartTime = [DateTime]::Now
8989
9090& {
9191 foreach ($file in Get-ChildItem - filter build.with.* .ps1) {
92- $techniqueName = $file.Name -replace ' \.build\.with' -replace ' \.ps1$'
93- $script = (Get-Command $file.FullName - CommandType ExternalScript).ScriptBlock
94- $time = Measure-Command { . $file.FullName }
95- [PSCustomObject ]@ {
96- Technique = $techniqueName
97- Time = $time
98- Script = $script
92+ try {
93+ $techniqueName = $file.Name -replace ' \.build\.with' -replace ' \.ps1$'
94+ $script = (Get-Command $file.FullName - CommandType ExternalScript).ScriptBlock
95+ $time = Measure-Command { . $file.FullName }
96+ [PSCustomObject ]@ {
97+ Technique = $techniqueName
98+ Time = $time
99+ Script = $script
100+ }
101+ } catch {
102+ Write-Warning " $file encountered an error: $_ "
99103 }
104+
100105 }
101106} | Tee-Object - Variable buildTimes
102107
@@ -238,5 +243,6 @@ Remove-Item -Recurse -Force ./astrodev
238243
239244Pop-Location
240245
246+ # Set our last exit code to 0
241247$LASTEXITCODE = 0
242-
248+ exit 0
You can’t perform that action at this time.
0 commit comments