Adding Start-SPMigrationGUI.ps1
This commit is contained in:
@@ -9,6 +9,8 @@ param(
|
||||
|
||||
[switch]$IncludeHiddenLists,
|
||||
|
||||
[string[]]$SelectedContainerUrls = @(),
|
||||
|
||||
[Alias("TargetWebUrl")]
|
||||
[string]$TargetUrl,
|
||||
|
||||
@@ -151,6 +153,49 @@ function Test-IsCatalogList {
|
||||
}
|
||||
}
|
||||
|
||||
function Test-SPContainerSelected {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[Microsoft.SharePoint.SPList]$List,
|
||||
|
||||
[string[]]$SelectedContainerUrls = @()
|
||||
)
|
||||
|
||||
if ($null -eq $SelectedContainerUrls -or $SelectedContainerUrls.Count -eq 0) {
|
||||
return $true
|
||||
}
|
||||
|
||||
$selectedLookup = @{}
|
||||
foreach ($selectedUrl in @($SelectedContainerUrls)) {
|
||||
if (-not [string]::IsNullOrWhiteSpace([string]$selectedUrl)) {
|
||||
$selectedLookup[[string]$selectedUrl.Trim().ToLowerInvariant()] = $true
|
||||
}
|
||||
}
|
||||
|
||||
if ($selectedLookup.Count -eq 0) {
|
||||
return $true
|
||||
}
|
||||
|
||||
$candidateUrls = @(
|
||||
[string]$List.RootFolder.ServerRelativeUrl,
|
||||
[string]$List.DefaultViewUrl,
|
||||
[string]$List.Title
|
||||
)
|
||||
|
||||
foreach ($candidateUrl in $candidateUrls) {
|
||||
if ([string]::IsNullOrWhiteSpace([string]$candidateUrl)) {
|
||||
continue
|
||||
}
|
||||
|
||||
$normalizedCandidateUrl = [string]$candidateUrl.Trim().ToLowerInvariant()
|
||||
if ($selectedLookup.ContainsKey($normalizedCandidateUrl)) {
|
||||
return $true
|
||||
}
|
||||
}
|
||||
|
||||
return $false
|
||||
}
|
||||
|
||||
function Get-SafeCollectionCount {
|
||||
param(
|
||||
$Value
|
||||
@@ -2796,6 +2841,7 @@ try {
|
||||
$web.Lists | Where-Object {
|
||||
$_.BaseType -eq [Microsoft.SharePoint.SPBaseType]::DocumentLibrary -and
|
||||
($IncludeHiddenLibraries -or -not $_.Hidden) -and
|
||||
(Test-SPContainerSelected -List $_ -SelectedContainerUrls $SelectedContainerUrls) -and
|
||||
-not (Test-IsCatalogList -List $_)
|
||||
}
|
||||
)
|
||||
@@ -2804,6 +2850,7 @@ try {
|
||||
$web.Lists | Where-Object {
|
||||
$_.BaseType -ne [Microsoft.SharePoint.SPBaseType]::DocumentLibrary -and
|
||||
($IncludeHiddenLists -or -not $_.Hidden) -and
|
||||
(Test-SPContainerSelected -List $_ -SelectedContainerUrls $SelectedContainerUrls) -and
|
||||
-not (Test-IsCatalogList -List $_)
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user