No problem! I sincerely hope the tsql code helps.
Like yourself, I haven't dove in to the powershell much yet...
______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience