I am attempting to execute a powershell script from another powershell script. I want some way to indicate that the script executed successfully, or that It failed. And if it failed, I would like to pass the exception along.
Here is my basic sript...
$Scripts = gci -Path $BuildForgeDir -filter "*.ps1"
As you can see, I find all powershell scripts...
ForEach($File in $Scripts){
Write-host("File: $File")
& "$BuildForgeDir\$File" -projName $projName -baseBfDir $baseDirA -debugOrRelease $debugOrRelease
}
And then I execute them...
How would I bubble up exceptions, failurs ect...