Adding Start-SPMigrationGUI.ps1
This commit is contained in:
9
.gui-state/Start-SPMigration/settings.json
Normal file
9
.gui-state/Start-SPMigration/settings.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"WindowHeight": 940,
|
||||||
|
"FontSize": 9,
|
||||||
|
"LastOutputPath": "C:\\Users\\CodexSandboxOffline\\.codex\\.sandbox\\cwd\\c85dc9d4b6e088fe\\SPMigrationOutput",
|
||||||
|
"LastMappingTablePath": "",
|
||||||
|
"LastSourceUrl": "",
|
||||||
|
"WindowWidth": 1400,
|
||||||
|
"LastTargetUrl": ""
|
||||||
|
}
|
||||||
@@ -9,6 +9,8 @@ param(
|
|||||||
|
|
||||||
[switch]$IncludeHiddenLists,
|
[switch]$IncludeHiddenLists,
|
||||||
|
|
||||||
|
[string[]]$SelectedContainerUrls = @(),
|
||||||
|
|
||||||
[Alias("TargetWebUrl")]
|
[Alias("TargetWebUrl")]
|
||||||
[string]$TargetUrl,
|
[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 {
|
function Get-SafeCollectionCount {
|
||||||
param(
|
param(
|
||||||
$Value
|
$Value
|
||||||
@@ -2796,6 +2841,7 @@ try {
|
|||||||
$web.Lists | Where-Object {
|
$web.Lists | Where-Object {
|
||||||
$_.BaseType -eq [Microsoft.SharePoint.SPBaseType]::DocumentLibrary -and
|
$_.BaseType -eq [Microsoft.SharePoint.SPBaseType]::DocumentLibrary -and
|
||||||
($IncludeHiddenLibraries -or -not $_.Hidden) -and
|
($IncludeHiddenLibraries -or -not $_.Hidden) -and
|
||||||
|
(Test-SPContainerSelected -List $_ -SelectedContainerUrls $SelectedContainerUrls) -and
|
||||||
-not (Test-IsCatalogList -List $_)
|
-not (Test-IsCatalogList -List $_)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -2804,6 +2850,7 @@ try {
|
|||||||
$web.Lists | Where-Object {
|
$web.Lists | Where-Object {
|
||||||
$_.BaseType -ne [Microsoft.SharePoint.SPBaseType]::DocumentLibrary -and
|
$_.BaseType -ne [Microsoft.SharePoint.SPBaseType]::DocumentLibrary -and
|
||||||
($IncludeHiddenLists -or -not $_.Hidden) -and
|
($IncludeHiddenLists -or -not $_.Hidden) -and
|
||||||
|
(Test-SPContainerSelected -List $_ -SelectedContainerUrls $SelectedContainerUrls) -and
|
||||||
-not (Test-IsCatalogList -List $_)
|
-not (Test-IsCatalogList -List $_)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
2211
Start-SPMigrationGUI.ps1
Normal file
2211
Start-SPMigrationGUI.ps1
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user