New-SPOMigrationPackage

用于在本地或网络共享文件夹中基于源文件创建新的迁移程序包的 Cmdlet。

注意

此 cmdlet 已弃用。 若要使用 PowerShell 迁移到 SharePoint 并Microsoft 365,请参阅 使用 PowerShell 迁移到 SharePoint

语法

Default (默认值)

New-SPOMigrationPackage
    [-SourceFilesPath] <String>
    [-OutputPackagePath] <String>
    [[-TargetWebUrl] <String>]
    [[-TargetDocumentLibraryPath] <String>]
    [[-TargetDocumentLibrarySubFolderPath] <String>]
    [-IncludeFileSharePermissions]
    [-ReplaceInvalidCharacters]
    [-IgnoreHidden]
    [-NoLogFile]
    [-NoAzureADLookup]
    [<CommonParameters>]

说明

用于在本地或网络共享文件夹中基于源文件创建新的迁移程序包的 Cmdlet。

示例

示例 1

New-SPOMigrationPackage -SourceFilesPath \\fileserver\share\folder1 -OutputPackagePath d:\MigrationPackages\Folder1_SrcPkg

New-SPOMigrationPackage -SourceFilesPath \\fileserver\share\folder1 -OutputPackagePath d:\MigrationPackages\Folder1_SrcPkg -TargetWebUrl https://contoso.sharepoint.com/sites/TargetSite/TargetWeb -TargetDocumentLibraryPath "Shared Documents" -TargetDocumentLibrarySubFolderPath "Sub Folder/Target Folder"

本示例基于在 \fileserver\share\folder1 源位置中找到的内容文件,在 d:\MigrationPackages\Folder1_SrcPkg 目录中使用默认 URL 值创建一组新的迁移源包元数据文件。

示例 2

New-SPOMigrationPackage -SourceFilesPath \\fileserver\share\folder1 -OutputPackagePath d:\MigrationPackages\Folder1_SrcPkg -TargetWebUrl https://contoso.sharepoint.com/sites/TargetSite/TargetWeb -TargetDocumentLibraryPath "Shared Documents"

此示例基于在 \fileserver\share\folder1 源位置中找到的内容文件,在 d:\MigrationPackages\Folder1_SrcPkg 目录中创建一组新的迁移源包元数据文件。 包是使用文档库路径“Documents”https://contoso.sharepoint.com/sites/TargetSite/TargetWeb/Shared 准备的。

参数

-IgnoreHidden

适用:SharePoint Online

用于忽略隐藏的文件和文件夹的开关。

参数属性

类型:System.Management.Automation.SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-IncludeFileSharePermissions

适用:SharePoint Online

用于将权限和共享信息包含在程序包元数据的生成清单文件中。

参数属性

类型:System.Management.Automation.SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-NoAzureADLookup

适用:SharePoint Online

切换到不查找 Microsoft Entra ID 中的本地用户帐户。

参数属性

类型:System.Management.Automation.SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-NoLogFile

适用:SharePoint Online

不用于创建日志文件。 默认值是在 OutputPackagePath 参数指定的目录中创建一个新的 CreateMigrationPackage 日志文件。

参数属性

类型:System.Management.Automation.SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-OutputPackagePath

适用:SharePoint Online

输出程序包元数据文件将保存到的目录位置。 如果目录不存在,则会创建一个。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:1
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ReplaceInvalidCharacters

适用:SharePoint Online

用于替换文件和文件夹名称中对 SharePoint Online 无效的字符的开关。

参数属性

类型:System.Management.Automation.SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-SourceFilesPath

适用:SharePoint Online

源内容文件所在的目录位置。 将枚举此目录以创建程序包元数据文件。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:0
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-TargetDocumentLibraryPath

适用:SharePoint Online

用作程序包元数据中基 URL 的文档库部分的与 Web 相关的文档库。 如果未提供,则将在包元数据中使用“文档”。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:3
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-TargetDocumentLibrarySubFolderPath

适用:SharePoint Online

指定用作程序包元数据基 URL 的文件夹路径部分的与文档库相关的子文件夹。 如果未提供,则在程序包元数据中将不使用任何值。 文件将驻留在文档库根目录下。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:4
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-TargetWebUrl

适用:SharePoint Online

用作程序包元数据中基 URL 的 Web 地址部分的完全限定 Web URL。 如果未提供,则将在包元数据中改用“https://fileserver/sites/user”。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:2
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters

输入

None

输出

System.Object

备注

SPO 包大小和文件大小限制

限制 最大大小 (Gb) 说明
包大小 2-4 整个包不能超过 4Gb
文件大小 2 源文件夹内的单个文件不能超过 2 Gb。
目标大小 - 在迁移完成之前,最终用户应保持无法访问目标站点

HTTP Get 限制

限制 API 获取 (字符) 说明
API 上的作 GET 260 个字符 API GET 请求的大小不能超过 260 个字符