Hi @brandon_owensby_2976 ,
Thanks for clarifying; so basically, you stop treating master as the "current release branch" once all the tickets in the sprint are closed. At that point, master becomes the "next release branch".
If further work is needed later (e.g. fixing a regression discovered by QA), then you create a "current release branch" from the build's commit and use that branch.
So, in that case, we recommend to mirror the real-world status in BuildMaster by setting the current release's branch to (nothing). Just do that when you create the "next release". That way, it won't match the new commit branch.
As for creating a script... honestly I'm not really sure. It's just not a use case we've considered and would probably iterating releases with @ReleasesInApplication and doing a $CompareReleaseSequence to find the latest one. Maybe you'd have to psexec to get powershell to write it more naturally.