How to capture data from a PowerShell script that runs as part of a SQL Agent Job?
Thanks to @Tony Hinkle for giving an answer as a comment. Here it is promoted to an actual answer, so hopefully the next person with this question finds it:

I created a table in my "Automation" database named "ImportRowCount" with one column named "RowCount" and inserted a single row in there with the number 0

Next, I added this line to my Powershell script:

invoke-sqlcmd -ServerInstance SQLServerHostName -Query "UPDATE Automation.dbo.ImportRowCount SET RowCount = $NumRows"


(Replace "SQLServerHostName" with your actual server's hostname)

So now my Powershell script updates that single row with the value of the $NumRows variable each time it runs.

This is perfect, since I can read the contents of that table before I run the remaining process, and I can use it as a decision point to branch my code into various different paths depending on how many rows are in the file.