LonGx
Cool Çırak
Birçok kez birçok SharePoint Solution'u bir SharePoint Farm'a yuklemeyi tek tek yapmaktayız. Ancak bir klasörden tüm solutionları yüklemek ve zamandan kazanmak için asağıdaki scripti kullanabilirsiniz:
add-pssnapin microsoft.sharepoint.powershell
$Solutions = Get-ChildItem -Path "C:\Temp\Solutions" | where {$_.extension -eq ".wsp"}
Write-Host 'DEPLOYING SOLUTIONS...'
foreach ($xSolution in $Solutions)
{
Write-Host 'Deploying: ' $xSolution.FullName
$time = Get-Date -DisplayHint Time
echo $time.ToString().Trim() - 'Deploying: ' $xSolution.FullName >> c:\Temp\Solutions\deploylog.txt
Add-SPSolution -LiteralPath $xSolution.FullName
Start-Sleep -s 5
Write-Host 'Deployed: ' $xSolution.FullName
$time = Get-Date -DisplayHint Time
echo $time.ToString().Trim() - 'Deployed: ' $xSolution.FullName >> c:\Temp\Solutions\deploylog.txt
}
Write-Host 'Completed!'
$time = Get-Date -DisplayHint Time
echo $time - 'Completed!' >> c:\Temp\Solutions\deploylog.txt
add-pssnapin microsoft.sharepoint.powershell
$Solutions = Get-ChildItem -Path "C:\Temp\Solutions" | where {$_.extension -eq ".wsp"}
Write-Host 'DEPLOYING SOLUTIONS...'
foreach ($xSolution in $Solutions)
{
Write-Host 'Deploying: ' $xSolution.FullName
$time = Get-Date -DisplayHint Time
echo $time.ToString().Trim() - 'Deploying: ' $xSolution.FullName >> c:\Temp\Solutions\deploylog.txt
Add-SPSolution -LiteralPath $xSolution.FullName
Start-Sleep -s 5
Write-Host 'Deployed: ' $xSolution.FullName
$time = Get-Date -DisplayHint Time
echo $time.ToString().Trim() - 'Deployed: ' $xSolution.FullName >> c:\Temp\Solutions\deploylog.txt
}
Write-Host 'Completed!'
$time = Get-Date -DisplayHint Time
echo $time - 'Completed!' >> c:\Temp\Solutions\deploylog.txt