I have a couple MOSS dev environments that need to have a script to restore the content databases from production. Part of the script has to set the site collection administrators to the user of the dev environment, as after being restored the sca's are changed to whatever production was.
I have a commandlet that will work, though only when run by an existing site collection admin. I know you can reference the SharePoint API through powershell, but the syntax of RunWithElevatedPrivileges requires the use of a delegate as the parameter. How would I do this in powershell?