Apply function against an array
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="https://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]
}