Adding Start-SPMigrationGUI.ps1

This commit is contained in:
Torsten Brendgen
2026-04-16 19:19:24 +02:00
parent 6c5236a405
commit 8de6047719
3 changed files with 2267 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
{
"WindowHeight": 940,
"FontSize": 9,
"LastOutputPath": "C:\\Users\\CodexSandboxOffline\\.codex\\.sandbox\\cwd\\c85dc9d4b6e088fe\\SPMigrationOutput",
"LastMappingTablePath": "",
"LastSourceUrl": "",
"WindowWidth": 1400,
"LastTargetUrl": ""
}

View File

@@ -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 $_)
}
)

2211
Start-SPMigrationGUI.ps1 Normal file

File diff suppressed because it is too large Load Diff