Skip to content

Latest commit

 

History

History
78 lines (57 loc) · 6.48 KB

MIGRATE-2.0-to-3.0.md

File metadata and controls

78 lines (57 loc) · 6.48 KB

Updating from PnP PowerShell 2.x to 3.x

This is a draft document, version 3 is not yet available. You can try this out with the nightly builds starting from 2.99.1 or later

The 3.x version of PnP PowerShell is based exclusively on .NET 8.0, which means that it will not work on older PowerShell editions like PowerShell 5.1, ISE or PowerShell 7.3 or older. It will work only on PowerShell 7.4.4 or later editions.

Steps to update from 2.x to 3.x

Or

  • For Windows environments, please use this link

  • For Linux based environments, please use this link

  • For Mac OS environments, please use this link

Once the PowerShell 7.4.4 or later is downloaded and installed in the environment, you can install the PnP PowerShell module like you normally do.

Install-Module -Name "PnP.PowerShell"

If you want to install or update to the latest nightly built prerelease of PnP PowerShell, run:

Install-Module -Name "PnP.PowerShell" -AllowPrerelease

Changes needed in Azure DevOps/GitHub Actions/Pipelines

If you are using PnP PowerShell in Azure Devops, GitHub Actions or other pipeline infrastructure, you will have to update your PowerShell version from v5 to v7.4.4 or later.

Recommend referring to these 2 links:

Breaking changes in 3.0

Cmdlet Comment
Get-PnPRetentionLabel The Get-PnPRetentionLabel cmdlet has been renamed to Get-PnPTenantRetentionLabel
Get-PnPLabel The Get-PnPLabel cmdlet has been renamed to Get-PnPRetentionLabel
Get-PnPPowerPlatformConnector The Get-PnPPowerPlatformConnector cmdlet has been renamed to Get-PnPPowerPlatformCustomConnector
Connect-PnPOnline Using Connect-PnPOnline without specifying an authentication option will now default to using an interactive login. If you still want to use logon using client credentials, provide them using -Credentials instead
Publish-PnPCompanyApp The Publish-PnPCompanyApp cmdlet has been removed
Set-PnPLabel Use Set-PnPRetentionLabel
Reset-PnPLabel Use Reset-PnPRetentionLabel
Add-PnPTeamsChannel The parameter IsFavoriteByDefault has been removed as it was not supported by Graph API
Get-PnPAppAuthAccessToken This cmdlet has been removed. Use Get-PnPAccessToken -ResourceTypeName SharePoint instead to get SharePoint access token.
Request-PnPAccessToken This cmdlet has been removed. Use Get-PnPAccessToken instead.
Get-PnPGraphAccessToken This cmdlet has been removed. Use Get-PnPAccessToken instead.
Remove-PnPUser The parameter -Confirm has been removed. Use -Force instead.
Remove-PnPAvailableSiteClassification The parameter -Confirm has been removed. Use -Force instead.
Send-PnPMail It now throws a warning about the retirement of SharePoint SendEmail API, if you are sending mails via SharePoint. To ignore the warning, use -ErrorAction SilentlyContinue along side the cmdlet. Recommendation is to use Send-PnPMail with Microsoft Graph
Send-PnPMail The support for sending mails via SMTP servers is now removed. It is the recommendation of .NET as SMTP doesn't support modern protocols. So, the parameters -EnableSSL , -UserName, -Password, -Server and -ServerPort are now removed. Use Send-PnPMail with Microsoft Graph
Invoke-PnPTransformation It has been removed. It was never supported nor fully implemented.
Get-PnPSharingLink The parameter -FileUrl has been removed. It was marked obsolete. Use -Identity instead.
Remove-PnPNavigationNode The parameters -Title and -Header have been removed. They were marked obsolete. Use -Identity instead.
Connect-PnPOnline Removed -UseWebLogin on Connect-PnPOnline. It used a very outdated and questionable (reusing an auth cookie) authentication method which implementation broke easily. If you require an ACS connection for certain functionality, consider using -ClientId in combination with -ClientSecret instead.
Connect-PnPOnline Removed -LaunchBrowser option for Interactive login flows. It is the default now and removed the popup based authentication option
Connect-PnPOnline Removed -LaunchBrowser option for Device Login flows. It is the default now.
Register-PnPEntraIDApp Removed -LaunchBrowser, -NoPopup and credential based auth. The default auth method is now Interactive.
Register-PnPEntraIDAppForInteractiveLogin Removed -LaunchBrowser, -NoPopup and credential based auth. The default auth method is now Interactive.
Set-PnPMinimalDownloadStrategy Removed cmdlet. If you need the functionality you can always turn on the feature with Enable-PnPFeature -Id 87294c72-f260-42f3-a41b-981a2ffce37a or turn it off with Disable-PnPFeature -Id 87294c72-f260-42f3-a41b-981a2ffce37a
Connect-PnPOnline Removed -SPOManagementShell option for authentication. It reduces the risk of changes from Microsoft which can potentially break the scripts . Use your own Entra ID app instead via -ClientId parameter.
Set-PnPTraceLog Removed cmdlet and introduced Start-PnPTraceLog and Stop-PnPTracelog with similar parameters and functionality

Other notable changes

Changes to output type

Cmdlet Comment
Get-PnPAccessToken The output type is now Microsoft.IdentityModel.JsonWebTokens.JsonWebToken, earlier it was System.IdentityModel.Tokens.Jwt
Get-PnPCustomAction The output type is now PnP.Core.Model.SharePoint.UserCustomAction, earlier it was Microsoft.SharePoint.Client.UserCustomAction