Homebrew/Powershell Script and Logs questions

I am trying to install homebrew then powershell core via homebrew in a script.
My script executes fine if ran from another computer, and on the computer I am deploying to, post deployment.

My workflow also only has this script.
My script:
CI=1 /usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
brew cask install powershell
brew install openssl
sudo cp /Volumes/test/sshd_config /etc/ssh
sudo launchctl stop com.openssh.sshd
sudo launchctl start com.openssh.sshd

“/Volumes/test” is the local directory of the “run” executable of MDS.
I do not know why this script is failing even though I checked the option to “Wait for network before installing resources”.

I heard there are plans for a “first-run script on login” in 1.9, which should solve this issue with homebrew/powershell, but I would just like to know if there is anything I can do at the moment.

I tried to use the Log Viewer but had no luck in producing anything.
I have tried to run the workflow from the recovery partition and as root while logged into an admin account while the log viewer has started.

Thank you for your time

If you look in /var/log/install.log, it will give more detailed output.

tim