Forum Discussion
Attach and upgrade multiple content databases in SharePoint
Hi bjfentress
try to add
Add-PSSnapin Microsoft.Sharepoint.Powershell
in Invoke-Parallel.ps1 too.
Cheers,
Federico
okay, I tried that and now I seem to get a different error:
Get-RunspaceData : The term 'param' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At E:\SharePoint\Scripts\Admin\Invoke-Parallel.ps1:544 char:13
+ Get-RunspaceData -wait
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (param:String) [Write-Error], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,Get-RunspaceData
- bjfentressFeb 27, 2019Copper ContributorI couldn't attach them, so I had to paste it into my reply below the colored command
- Feb 27, 2019I can't see attachment :)
- bjfentressFeb 27, 2019Copper Contributor
Sure, here is my main script below. The Mount script and DB name file are attached. The invoke-parallel is the same except with the add-pssnapin added at the top of the script.
. "E:\SharePoint\Scripts\Admin\Invoke-Parallel.ps1"
Invoke-Parallel -ScriptFile E:\SharePoint\Scripts\Admin\MountDB.ps1 -InputObject $(Get-Content E:\Export.txt)
MountDB.ps1 Script:
Add-PSSnapin microsoft.sharepoint.powershell
param ($DBName)
$WebApp = "https://webapp.domain.com"
$SQLServer = "sqlserver"
Mount-SPContentDatabase -Name $DBName -WebApplication $WebApp -DatabaseServer $SQLServerExport.txt
WSS_Content_1
WSS_Content_2
- Feb 27, 2019Can you post the full script please?
Does the "single" (not parallel) script works correct?
Another way is debug script with Powershell IDE
Cheers,
Federico