# Example:
"D:\SiteBackUp\" - Remember the backward slash '\' at the end of the
path.
$SharedLocation = "D:\Projects\DeployFiles\New
Folder\"
# Example:
"http://siteurl/"
$Weburl = "servername"
# Example: 80
$WebPort = "33980"
#
**********************************************************************************************************************************
# Check if folder exists
if (Test-Path $SharedLocation)
{
# Get all the
WSP files from the solution folder
$list = Get-ChildItem ($SharedLocation) | where {$_.extension -eq ".wsp"}
# Loop through
each wsp file in the solutions folder
foreach($wspfile in $list)
{
# Retrieve the
solution package already added
$CheckPackage = Get-SPSolution -identity $wspfile.Name
write-host "Deploying
Solution: " $wspfile.Name
if ($CheckPackage)
{
if ($CheckPackage.ContainsWebapplicationResource)
{
if ($CheckPackage.ContainsGlobalAssembly)
{
Update-SPSolution –Identity $CheckPackage –LiteralPath ($SharedLocation + $wspfile.Name) -GacDeployment
}
else
{
Update-SPSolution –Identity $CheckPackage –LiteralPath ($SharedLocation + $wspfile.Name)
}
}
else
{
if ($CheckPackage.ContainsGlobalAssembly)
{
Update-SPSolution –Identity $CheckPackage –LiteralPath ($SharedLocation + $wspfile.Name) -GacDeployment
}
else
{
Update-SPSolution –Identity $CheckPackage –LiteralPath ($SharedLocation + $wspfile.Name)
}
}
}
}
write-host "Solution
pack upgrades completed successfully...!"
}
else
{
" No
shared/local folder found ! Please check the shared location path !!"
}
No comments:
Post a Comment