Apply function against an array

14/01/2012 00:10

function vypisParametrov
{
    param(
        [string]$url,
        [string]$nodeUrl,
        [string]$nodeName
    )
  
 write-host "On url site: "$url " we add a tab: '"$nodeName "', which will head to: " $nodeUrl "."
    
}

$url="http://portal.avd.com/sites/test"

$tab=@("Contact us", "CatCards", "FAQ", "Glossary")
$tabLink=@("/HelpDesk/SitePages/ContactUs.aspx",
            "/CategoryCards/View/AllItems.aspx",
            "/HelpDesk/faq/Vieww/AllItems.aspx",
            "/HelpDesk/Lists/Glossary-ListInstance1.aspx" )


for($i=0; $i -le $tab.length-1; $i++)
{
    vypisParametrov -url $url -nodeUrl $tabLink[$i] -nodeName $tab[$i]
}