I have duplicated it many times and changed variables so that each line sets a new, different advertisement. I tried putting all of these lines into a text file (using notePad++) with each string on a line then saved it as a PS1. When I ran it in PowerShell, though, it failed. Once it ran, but froze half way through. If I copy / paste / run each line separately, it works great.

That shouldn't be an issue at all. It might "pause" for some time in-midst of execution, if the server has to do some work, but then continue. However, allowing for some rest by inserting sleeps is a good idea.
BTW, one way to implement multiple commands with the same parameters is by "splashing". That is you put the common parameters into a hash table. That allows for better readability:

You guess wrong, Raheman. The semi-colon is a command separator, and required only if you put hash key/value pair or commands on a single line:
Get-ChildItem; Get-User
is the same as
Get-ChildItem
Get-User
The same applies to hash tables.

Featured Post

Administration of Active Directory does not have to be hard. Too often what should be a simple task is made more difficult than it needs to be.The solution? Hyena from SystemTools Software. With ease-of-use as well as powerful importing and bulk updating capabilities.