Here, I need to checkout a file in SharePoint document library using PnP PowerShell cmdlets. when i'm executing this script on windows powershell ISE.
Connect-PnPOnline -Url https://szg52.sharepoint.com/sites/SalesDepartmentTeam -Credentials (Get-Credential)
Set-PnPFileCheckedOut -Url "/CompanyBasicInformation/Company%20Info.pdf"
Then Im getting this below error.
Plese provide solution to this error
But the same script is working on PowerShell7.
Im expecting how to run these pnp commands on windows powershell ISE.
The latest release channel (2.x) of PnP.PowerShell depends on at least .NET 6, which is why it can't be loaded in Windows PowerShell or ISE.
From the GitHub project README:
You can install a previous version that works in Windows PowerShell by explicitly specifying the version when installing the module:
Although I'd personally suggest replacing PowerShell ISE with Visual Studio Code - that way you'll be able to access and use the latest version from your development environment