Skip to content

ConvertTo-MigrationEncryptedPackage

SharePoint Online: Creates an encrypted migration package

#Requires -Version 5.1
#Requires -Modules Microsoft.Online.SharePoint.PowerShell

[CmdletBinding(DefaultParameterSetName = "ImplicitSource")]
Param(
    [Parameter(Mandatory = $true, ParameterSetName = "ExplicitSource")]
    [Parameter(Mandatory = $true, ParameterSetName = "ImplicitSource")]
    [string]$EncryptionParameters,

    [Parameter(Mandatory = $true, ParameterSetName = "ImplicitSource")]
    [string]$MigrationSourceLocations,

    [Parameter(Mandatory = $true, ParameterSetName = "ExplicitSource")]
    [string]$SourceFilesPath,

    [Parameter(Mandatory = $true, ParameterSetName = "ExplicitSource")]
    [string]$SourcePackagePath,

    [Parameter(Mandatory = $true, ParameterSetName = "ExplicitSource")]
    [Parameter(Mandatory = $true, ParameterSetName = "ImplicitSource")]
    [string]$TargetFilesPath,

    [Parameter(Mandatory = $true, ParameterSetName = "ExplicitSource")]
    [Parameter(Mandatory = $true, ParameterSetName = "ImplicitSource")]
    [string]$TargetPackagePath,

    [Parameter(ParameterSetName = "ExplicitSource")]
    [Parameter(ParameterSetName = "ImplicitSource")]
    [switch]$NoLogFile
)

Process {
    try {
        $cmdArgs = @{ ErrorAction = 'Stop'; NoLogFile = $NoLogFile; EncryptionParameters = $EncryptionParameters; TargetFilesPath = $TargetFilesPath; TargetPackagePath = $TargetPackagePath }
        if ($PSCmdlet.ParameterSetName -eq "ImplicitSource") { $cmdArgs.Add('MigrationSourceLocations', $MigrationSourceLocations) }
        else { $cmdArgs.Add('SourceFilesPath', $SourceFilesPath); $cmdArgs.Add('SourcePackagePath', $SourcePackagePath) }
        $result = ConvertTo-SPOMigrationEncryptedPackage @cmdArgs | Select-Object *
        if ($null -ne $result) { $result | Add-Member -NotePropertyName Timestamp -NotePropertyValue (Get-Date -Format "yyyy-MM-dd HH:mm:ss") -PassThru -Force }
    }
    catch { throw }
}

Encryption parameters (e.g., SHA384, SHA256)

Migration source locations (for implicit source)

Temporary path with XML source files (explicit source)

Source package path (explicit source)

Temporary path for target XML files

Target package path for encrypted output

Off

Suppress log file generation

An interactive directory of PowerShell scripts.