how can we convert Powershell script of 5.1 version to 7 version? #2851
Replies: 2 comments
-
Hi! You can't yet. The current release of PnP PowerShell requires the .NET Framework, whereas PowerShell 7 uses the .NET Core framework. It's similar, but different enough to the level that we need to release a specific version of PnP PowerShell for that. We are actively working on that and we will release it within a few weeks. |
Beta Was this translation helpful? Give feedback.
-
@erwinvanhunen |
Beta Was this translation helpful? Give feedback.
-
Please let us, how can convert Powershell script of 5.1 version to 7 version? We are facing lot of code changes and issues, for e.g
This code is work well with powershell 5.1.
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteURL)
$Ctx.Credentials = $Cred
$web = $Ctx.Web
$Ctx.Load($web)
$Ctx.ExecuteQuery()
But with PowerShell 7, its throw below error:
Error in connecting the CSOM context : The remote server returned an error: (400) Bad Request.
Even,
$latestItem = Get-PnPListItem -List $listTitle -Id 224 -Fields "Status",
doesn't return any result in PowerShell 7.
Beta Was this translation helpful? Give feedback.
All reactions