Date and Month display

Get WSP status across Farm level using powershell

<#
******-----------------------------------------------------------------------******
Author      -> Shiv Mangal Singh
Date        -> April 5, 2016
Description -> This script is used to get all WSP details("GlobalDeployed"|"NotDeployed"|"Web Application level deployed") across Farm Level
# Syntax: $title --> WSP Name; $status -->WSP deploymentstate ; $path --> CSV file location
# e.g: .\Get_WSP_Details_across_FarmLevel.ps1

# Local
$outputFil "D:\Test\Shiv\ps\WSPStatus_Report.csv"
******-----------------------------------------------------------------------******
 #>
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$path = "D:\contoso_MW_Team\Shiv\WSPDetails\WSP_Details.csv"
#Write CSV- TAB Separated File Header
"WSP Name `t Status\DeploymentState `t Webapplication Name\Deployed To" | out-file $path
foreach ($solution in Get-SPSolution)
{
$title = $Solution.Name
# Get the WSP deployment State("GlobalDeployed"|"NotDeployed"|"Web Application level deployed" )
$status =$Solution.DeploymentState
#Write-host $status  -nonewline
 foreach($wspstatus in $status)
 {
    if($wspstatus -eq "GlobalDeployed")
             {
               "$title `t $wspstatus `t Globally Deployed " | Out-File $path -Append
             }
             elseif($wspstatus -eq "NotDeployed")
             {
              "$title `t $wspstatus `t None " | Out-File $path -Append
             }
 # If the WSP is deployed @ Web application level, Than get the Web application URL
 foreach ($deployedWebApplication in $solution.DeployedWebApplications)
   {
    $WebAppUrl=$deployedWebApplication.Url
    "$title `t $wspstatus `t $WebAppUrl " | Out-File $path -Append
   }
 }
}

No comments:

Post a Comment