Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $dirName = "C:\WSP" if (!(Test-Path -path $dirName)) { New-Item $dirName -type directory } Write-Host Exporting solutions to $dirName foreach ($solution in Get-SPSolution) { $id = $Solution.SolutionID $title = $Solution.Name $filename = $Solution.SolutionFile.Name Write-Host "Exporting ‘$title’ to …\$filename" -nonewline try { $solution.SolutionFile.SaveAs("$dirName\$filename") Write-Host " – done" -foreground green } catch { Write-Host " – error : $_" -foreground red } } Note: If need any help please reach out to me at kamal_pandey@outlook.com. I would be very happy to help.
Office 365, Azure, SharePoint, Powershell, Teams, PnP, SpFx and Microsoft Power Platform