I have a script which loops over different sites in a Sitecore instance. For each site some tasks are done, such as creating and moving items. How can I set the language context for these operations based on the language set in the config for the current site (if this is not feasible, I would settle for using the language of the current item).
$sites = Get-Item master: -Query "fast:/sitecore/content/Master//*[@@templatename='Website']";
foreach ($site in $sites) {
#determine the correct language of the $site item based off the sites configuration setting
}