Julie,
Welcome to the forum.
Please do not hijack other peoples threads. Instead create a new one for yourself and if needed place a link to the other thread if needed. In this case it doesm’t even fit to the question of the original question.
Even if it may be possible PowerShell is not made for such tasks. But there are scripting language particularely invented for those scenarios. You may take a look at
and
Both have been actually invented to be able to automate installations not intended to be automated.