Skip to content

Commit

Permalink
Merge branch 'pnp:dev' into unlockrecord
Browse files Browse the repository at this point in the history
  • Loading branch information
reshmee011 authored Nov 23, 2024
2 parents 4dcfef1 + de06c07 commit c6c5e9a
Show file tree
Hide file tree
Showing 79 changed files with 3,104 additions and 2,893 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/buildpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,20 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
dotnet-version: |
8.0.x
9.0.x
- name: Install PnP.Core dependencies
run: dotnet restore
working-directory: pnpcore/src/sdk
- name: Build PnP.Core
run: dotnet build --configuration Debug --no-restore -p:WarningLevel=0
working-directory: pnpcore/src/sdk/PnP.Core
- name: Install PnP.Framework dependencies
run: dotnet restore -p:PnPCoreSdkPath="..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\netstandard2.0\PnP.Core.dll" -p:PnPCoreSdkPathNet8="..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net8.0\PnP.Core.dll"
run: dotnet restore -p:PnPCoreSdkPath="..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\netstandard2.0\PnP.Core.dll" -p:PnPCoreSdkPathNet8="..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net8.0\PnP.Core.dll" -p:PnPCoreSdkPathNet9="..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net9.0\PnP.Core.dll"
working-directory: pnpframework/src/lib
- name: Build PnP.Framework
run: dotnet build --configuration Debug --no-restore -p:WarningLevel=0 -p:PnPCoreSdkPath="..\..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\netstandard2.0\PnP.Core.dll" -p:PnPCoreSdkPathNet8="..\..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net8.0\PnP.Core.dll"
run: dotnet build --configuration Debug --no-restore -p:WarningLevel=0 -p:PnPCoreSdkPath="..\..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\netstandard2.0\PnP.Core.dll" -p:PnPCoreSdkPathNet8="..\..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net8.0\PnP.Core.dll" -p:PnPCoreSdkPathNet9="..\..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net9.0\PnP.Core.dll"
working-directory: pnpframework/src/lib/PnP.Framework
- name: Install PnP.PowerShell dependencies
run: dotnet restore -p:PnPFrameworkPath="..\..\..\pnpframework\src\lib\" -p:PnPCoreSdkPath="..\..\..\pnpcore\src\sdk\"
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/nightlyrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.x
7.x
dotnet-version: |
8.x
9.x
- uses: actions/checkout@v4
with:
ref: dev
Expand Down
40 changes: 34 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,44 @@
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Attach",
"name": "PowerShell cmdlets: pwsh",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
"request": "launch",
"preLaunchTask": "Build with nugets",
"program": "pwsh",
"args": [
"-NoExit",
"-NoProfile",
"-Command",
"Import-Module ${userHome}/.local/share/powershell/Modules/PnP.PowerShell.psd1",
],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"console": "externalTerminal"
},
{
"name": ".NET Framework Attach",
"type": "clr",
"name": ".NET Core Launch with Nuget Build(console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build with nugets",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"console": "externalTerminal",
"program": "pwsh",
"osx": {
"program": "pwsh",
},
"windows": {
"program": "pwsh.exe"
}
},
{
"preLaunchTask": "Build with nugets",
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
"processId": "${command:pickProcess}",
}
]
}
7 changes: 6 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@
"group": {
"kind": "build",
"isDefault": true
}
},
"icon": {
"id": "run",
"color": "terminal.ansiYellow"
},

},
{
"label": "Build with local copy of PnP Framework/PnP Core SDK",
Expand Down
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled` to `Set-PnPTenant` which allows for updating of web property bag when DenyAddAndCustomizePages is enabled [#4508](https://github.com/pnp/powershell/pull/4508)
- Added `SiteId` to the output of `Get-PnPTenantSite` [#4527](https://github.com/pnp/powershell/pull/4527)
- Added `Add-PnPFileSensitivityLabel` which allows for assigning sensitivity labels to SharePoint files [#4538](https://github.com/pnp/powershell/pull/4538)
- Added `-CanSyncHubSitePermissions` parameter to `Set-PnPSite` cmdlet to set value of allowing syncing hub site permissions to this associated site.
- Added `Get-PnPProfileCardProperty`, `New-PnPProfileCardProperty` and `Remove-PnPProfileCardProperty` cmdlets to manage showing additional properties on the Microsoft 365 user profile [#4548](https://github.com/pnp/powershell/pull/4548)
- Added `-Contributors` and `-Managers` parameters to `New-PnPTermGroup` and `Set-PnPTermGroup` cmdlets.
- Added `-Files` parameter for `Send-PnPMail` cmdlet to allow files to be downloaded from SharePoint and then sent as attachments.

### Changed

- **PnP PowerShell is now .NET 8.0 based, and requires PowerShell 7.4.**
- **PnP PowerShell is now .NET 8.0 based, and requires PowerShell 7.4.4 or newer**
- **`-Interactive` login is now the default.**
- The Popup based authentication for Interactive Login has been removed and replaced by a browser flow
- `-LaunchBrowser` has been removed for interactive login
- `-LaunchBrowser` for Device Login authentication flows has been renamed to `OpenBrowser`
- **Rate limiting is now enabled by default for all cmdlets which are being executed under application permissions.**
- Changed the UI experience when logging in with Interactive login and specifying `-LaunchBrowser` on `Connect-PnPOnline`. This experience is the default on MacOS.
- In case of errors when Graph batch method is used, it will now throw a clearer error message about what was the issue. [#4327](https://github.com/pnp/powershell/pull/4327/)
- `Get-PnPAccessToken`, `Request-PnPAccessToken` and `Get-PnPGraphAccessToken` output type is changed to `Microsoft.IdentityModel.JsonWebTokens.JsonWebToken`. Earlier they returned `System.IdentityModel.Tokens.Jwt`.
- `New-PnPContainerType` will temporarily disable standard containers to be created due to changed being applied at Microsoft to allow this to be possible in the future [#4125](https://github.com/pnp/powershell/pull/4125)
Expand All @@ -54,6 +63,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- When passing in an existing connection using `-Connection` on `Connect-PnPOnline`, the clientid from the passed in connection will be used for the new connection [#4425](https://github.com/pnp/powershell/pull/4425)
- Removed `-Confirm` parameter from `Remove-PnPUser` and `Remove-PnPAvailableSiteClassification` cmdlets. Use `-Force` instead. [#4455](https://github.com/pnp/powershell/pull/4455)
- `Get-PnPFile` now also supports passing in a full SharePoint Online URL [#4480](https://github.com/pnp/powershell/pull/4480)
- `Send-PnPMail` now throws a warning about the retirement of the SharePoint SendEmail API.

### Fixed

Expand All @@ -71,18 +81,27 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fixed the PnP PowerShell version check to only check nightly version in nightly builds and major version in release builds. [#4453](https://github.com/pnp/powershell/pull/4453)
- Fixed `-ConsistencyLevelEventual` flag on `Invoke-PnPGraphMethod` to work correctly. [#4523](https://github.com/pnp/powershell/pull/4523)
- Fixed `Get-PnPServiceHealthIssue` returning an error when certain service states were active [#4530](https://github.com/pnp/powershell/pull/4530)
- Fixed `Add-PnPFileSensitivityLabel` cmdlet to allow empty string value to reset file sensitivity label.

### Removed

- Removed `-LaunchBrowser` option on `Connect-PnPOnline` for interactive logins and device logins as it is default now and the popup based authentication window has been removed.
- Removed `-UseWebLogin` option on `Connect-PnPOnline`. It used a very old, questionable approach to authentication. Use `-Interactive` or if you require an ACS connection `-ClientId` and `-ClientSecret`
- Removed `Invoke-PnPTransformation` cmdlet as it was never supported.
- Removed `Publish-PnPCompanyApp` cmdlet as it was not supported anymore. [#4387](https://github.com/pnp/powershell/pull/4387)
- Removed `-UserVoiceForFeedbackEnabled` parameter from `Set-PnPTenant` cmdlet as it was obsolete. [#4387](https://github.com/pnp/powershell/pull/4387)
- Removed `Set-PnPLabel` and `Reset-PnPLabel` aliases. You need to use `Set-PnPRetentionLabel` and `Reset-PnPRetentionLabel` respectively. [#4387](https://github.com/pnp/powershell/pull/4387)
- Removed `Get-PnPPowerPlatformConnector` alias. You need to use `Get-PnPPowerPlatformCustomConnector`. [#4387](https://github.com/pnp/powershell/pull/4387)
- Removed `-IsFavoriteByDefault` parameter from `Add-PnPTeamsChannel` cmdlet. It was obsolete and not supported by Graph API. [#4387](https://github.com/pnp/powershell/pull/4387)
- Removed `Get-PnPAppAuthAccessToken` , `Remove-PnPGraphAccessToken` and `Request-PnPAccessToken` cmdlets. Use `Get-PnPAccessToken` instead. [#4398](https://github.com/pnp/powershell/pull/4398)
- Removed support for sending mail via SMTP in `Send-PnPMail`. It's usage is not recommended by .NET due to its lack of support for modern protocols.
- Removed `-Title` and `-Header` parameters from `Remove-PnPNavigationNode`. They were marked obsolete.
- Removed `-FileUrl` parameter from `Get-PnPSharingLink`. It was marked obsolete.
- Removed `-WebLogin` parameter from `Connect-PnPOnline` cmdlet. It was marked obsolete and was a security risk.

### Contributors

- Konrad K. [wilecoyotegenius]
- Antti K. Koskela [koskila]
- Steve Beaugé [stevebeauge]
- [reusto]
Expand Down
20 changes: 14 additions & 6 deletions MIGRATE-2.0-to-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

_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 or later editions.**
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

Expand All @@ -16,7 +16,7 @@ Or

- For Mac OS environments, please use [this link](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos)

Once the PowerShell 7.4 or later is downloaded and installed in the environment, you can install the PnP PowerShell module like you normally do.
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.

```powershell
Install-Module -Name "PnP.PowerShell"
Expand All @@ -30,7 +30,7 @@ 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 or later.
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:

Expand All @@ -49,11 +49,19 @@ Recommend referring to these 2 links:
| 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 | It has been removed. Use `Get-PnPAccessToken -ResourceTypeName SharePoint` instead to get SharePoint access token. |
| Request-PnPAccessToken | It has been removed. Use `Get-PnPAccessToken` instead. |
| Get-PnPGraphAccessToken | It has been removed. Use `Get-PnPAccessToken` instead. |
| 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](https://devblogs.microsoft.com/microsoft365dev/retirement-of-the-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](https://pnp.github.io/powershell/cmdlets/Send-PnPMail.html#send-through-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](https://pnp.github.io/powershell/cmdlets/Send-PnPMail.html#send-through-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. |

## Other notable changes

Expand Down
23 changes: 18 additions & 5 deletions build/Build-Debug.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,30 @@ $localPnPFrameworkPathValue = $env:PnPFrameworkPath
$env:PnPCoreSdkPath = ""
$env:PnPFrameworkPath = ""

$versionFileContents = Get-Content "$PSScriptRoot/../version.txt" -Raw
if ($versionFileContents.Contains("%")) {
$versionString = $versionFileContents.Replace("%", "0");
$versionFileContents = Get-Content "$PSScriptRoot/../version.json" -Raw | ConvertFrom-Json

if ($versionFileContents.Version.Contains("%")) {
$versionString = $versionFileContents.Version.Replace("%", "0");
$versionObject = [System.Management.Automation.SemanticVersion]::Parse($versionString)
$buildVersion = $versionObject.Patch;
}
else {
$versionObject = [System.Management.Automation.SemanticVersion]::Parse($versionFileContents)
$versionObject = [System.Management.Automation.SemanticVersion]::Parse($versionFileContents.Version)
$buildVersion = $versionObject.Patch + 1;
}

$configuration = "net8.0-windows"
# $versionFileContents = Get-Content "$PSScriptRoot/../version.txt" -Raw
# if ($versionFileContents.Contains("%")) {
# $versionString = $versionFileContents.Replace("%", "0");
# $versionObject = [System.Management.Automation.SemanticVersion]::Parse($versionString)
# $buildVersion = $versionObject.Patch;
# }
# else {
# $versionObject = [System.Management.Automation.SemanticVersion]::Parse($versionFileContents)
# $buildVersion = $versionObject.Patch + 1;
# }

$configuration = "net8.0"

$version = "$($versionObject.Major).$($versionObject.Minor).$buildVersion"

Expand Down Expand Up @@ -151,6 +163,7 @@ if ($LASTEXITCODE -eq 0) {
Author = 'Microsoft 365 Patterns and Practices'
CompanyName = 'Microsoft 365 Patterns and Practices'
CompatiblePSEditions = @('Core')
PowerShellVersion = '7.4.4'
ProcessorArchitecture = 'None'
FunctionsToExport = '*'
CmdletsToExport = @($cmdletsString)
Expand Down
Loading

0 comments on commit c6c5e9a

Please sign in to comment.