0

如何使这个逻辑在 powershell 中工作?

$i = ("SharePointCDPTestProject1_Feature1", "SharePointCDPTestProject1_Feature2", "SharePointCDPTestProject1_Feature3"); 
$a = Get-SPSite  http://localhost/sts*;
Foreach($id in $i)
{
    Foreach($p in $a)
    {
        Enable-SPFeature –identity $id -URL $p
    }
}

对不起..我是ps的菜鸟

4

1 回答 1

1
$i = ("SharePointCDPTestProject1_Feature1", "SharePointCDPTestProject1_Feature2", "SharePointCDPTestProject1_Feature3"); 
$a = Get-SPSite  http://localhost/sts*;
$i | Foreach{
    #save current id
    $id=$_
    $a | Foreach{
        Enable-SPFeature –identity $id -URL $_
    }
}
于 2012-12-13T08:13:05.577 回答