PowerShell; SharePoint 2010: Set Alternate Access Mapping

I need to set Alternate Access Mapping remotely as part of my automation. I can’t find how to specify PowerShell version for Invoke-Command CMDlet. So I decided to use this workaround: Invoke-Command -computer sp2010.vlasenko.org -script { $command = “Add-PSSnapin Microsoft.SharePoint.PowerShell; New-SPAlternateURL ‘http://vlasenko.nmsp.org’ -Zone ‘Internet’ -WebApplication ‘SharePoint – 80′” PowerShell -v 2 -Command “& { $commandContinue reading “PowerShell; SharePoint 2010: Set Alternate Access Mapping”