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 Dec 18, 2024
2 parents 334312f + f368ee8 commit 613609c
Show file tree
Hide file tree
Showing 626 changed files with 9,156 additions and 8,338 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `-Files` parameter for `Send-PnPMail` cmdlet to allow files to be downloaded from SharePoint and then sent as attachments.
- Added `-Force` parameter to `Set-PnPPropertyBagValue` cmdlet to toggle NoScript status of the site.
- Added `-Batch` parameter to `Invoke-PnPGraphMethod` cmdlet to allow adding request in a batch.
- Added `-List` parameter to `Get-PnPFolderItem`, `Get-PnPFileInFolder` and `Get-PnPFolderInFolder` which allows them to work with a document library containing more than 5,000 items [#4611](https://github.com/pnp/powershell/pull/4611)
- Added `Start-PnPTraceLog`, `Stop-PnPTraceLog` and `Get-PnPTraceLog` cmdlets to handle tracelogging. Removed `Set-PnPTraceLog` cmdlet.
- Added `-ListPermissionScopes` parameter on `Get-PnPAccessToken` cmdlet to list the current permission scopes on the current access token.
- Added `Get-PnPCopilotAgent` cmdlet that returns the Microsoft Copilot Agents in a site collection.
- Added `Get-PnPFileRetentionLabel` cmdlet to fetch the file retention labels. [#4603](https://github.com/pnp/powershell/pull/4603)
- Added `Get/Set/Remove-PnPUserProfilePhoto` cmdlet to download, upload or remove the profile photo of the specified user.

### Changed

Expand Down Expand Up @@ -91,7 +97,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- 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.

- Fix `Connect-PnPOnline` cmdlet not working with On Prem related cmdlets. [#4622](https://github.com/pnp/powershell/pull/4622)
- Fix `Get\Invoke-PnPSiteTemplate` cmdlet not working in vanity domains. [#4630](https://github.com/pnp/powershell/pull/4630)

### Removed

- Removed `-LaunchBrowser`, `-NoPopup` and credential based auth on `Register-PnPEntraIDApp` and `Register-PnPEntraIDAppForInteractiveLogin` cmdlets. The default auth method is now Interactive.
Expand All @@ -110,9 +118,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Removed `-WebLogin` parameter from `Connect-PnPOnline` cmdlet. It was marked obsolete and was a security risk.
- Removed `Set-PnPMinimalDownloadStrategy` as it's not applicable anymore to SharePoint Online. 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`
- Removed `-SPOManagementShell` parameter from `Connect-PnPOnline` cmdlet. It reduces the risk of changes coming from Microsoft. Use your own Entra ID app instead.
- Removed `Set-PnPTraceLog` cmdlet and introduced `Start-PnPTraceLog` and `Stop-PnPTraceLog` with similar parameters.

### Contributors

- Janne Holm [jhholm]
- Paul Bullock [pkbullock]
- Arjan Cornelissen [arjancornelissen]
- Konrad K. [wilecoyotegenius]
- Antti K. Koskela [koskila]
Expand Down
3 changes: 2 additions & 1 deletion MIGRATE-2.0-to-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Recommend referring to these 2 links:
| 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

Expand All @@ -74,4 +75,4 @@ Recommend referring to these 2 links:
| **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` |
| Get-PnPCustomAction| The output type is now `PnP.Core.Model.SharePoint.UserCustomAction`, earlier it was `Microsoft.SharePoint.Client.UserCustomAction` |
8 changes: 4 additions & 4 deletions dependencies.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Updated": "20241202-025444",
"PnPPowerShell": "ec09501bddd2e692a5f81025a52ce7b4a0617455",
"PnPFramework": "f741f2780ac9e24d1b65bb9dddaa5695982905a6",
"PnPCore": "2d2df5fa676e1fa063eb45907e69a40817eaa6ac"
"Updated": "20241218-024853",
"PnPPowerShell": "614fc0de671cf0dab5f92c2ec4b528dc39158ab9",
"PnPFramework": "af52c5fdc25b6640c0dea0eaebcf9138e364de02",
"PnPCore": "b960b12c188b936c43e846e2774a629969a016a1"
}
2 changes: 1 addition & 1 deletion documentation/Connect-PnPOnline.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ Accept wildcard characters: False
```
### -PersistLogin
Persist the current access token and related information in a locally stored cache. This cache will be retained between PowerShell sessions and will also be available after a reboot. You only need to provide this switch one time on Connect-PnPOnline cmdlet, it will after that retain the information and reuse it for new connections to the same tenant. If you want to clear the cache entry, use `Disconnect-PnPOnline -ClearPersistedLogin`
Persist the current access token and related information in a locally stored cache. This cache will be retained between PowerShell sessions and will also be available after a reboot. You only need to provide this switch one time on Connect-PnPOnline cmdlet, it will after that retain the information and reuse it for new connections to the same tenant. Notice that while using a cached token, if you change the permissions of an application registration, the token associated with that registration will not be updated automatically in the cache. You will have to clear the cache entry first and reauthenticate: use `Disconnect-PnPOnline -ClearPersistedLogin`

```yaml
Type: SwitchParameter
Expand Down
2 changes: 1 addition & 1 deletion documentation/Disconnect-PnPOnline.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Disconnect-PnPOnline [-ClearPersistedLogin]

## DESCRIPTION

Disconnects the current connection and clears its token cache. It will require you to build up a new connection again using [Connect-PnPOnline](Connect-PnPOnline.md) in order to use any of the PnP PowerShell cmdlets. You will have to reauthenticate. If instead you simply want to connect to another site collection within the same tenant using the same credentials you used previously, do not use this cmdlet but instead use `Connect-PnPOnline -Url https://tenant.sharepoint.com/sites/othersite` instead without disconnecting. It will try to reuse the existing authentication method and cached credentials.
Disconnects the current connection and optionally clears its token cache. It will require you to build up a new connection again using [Connect-PnPOnline](Connect-PnPOnline.md) in order to use any of the PnP PowerShell cmdlets. You might have to reauthenticate. If instead you simply want to connect to another site collection within the same tenant using the same credentials you used previously, do not use this cmdlet but instead use `Connect-PnPOnline -Url https://tenant.sharepoint.com/sites/othersite` instead without disconnecting. It will try to reuse the existing authentication method and cached credentials.

Note that this cmdlet does not support passing in a specific connection to disconnect. If you wish to dispose a specific connection you have set up in a variable using `$variable = Connect-PnPOnline -ReturnConnection`, just dispose that variable using `$variable = $null` and it will be cleared from memory.

Expand Down
45 changes: 43 additions & 2 deletions documentation/Get-PnPAccessToken.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,33 @@ If a Resource Type Name or Resource URL is specified, it will fetch the access t

## SYNTAX

### Graph Token

```powershell
Get-PnPAccessToken [-ResourceTypeName] [-Decoded] [-Scopes] [-Connection <PnPConnection>]
```

### Specific resource by type

```powershell
Get-PnPAccessToken -ResourceTypeName <ResourceTypeName> [-Decoded] [-Scopes] [-Connection <PnPConnection>]
```

### Specific resource by URL

```powershell
Get-PnPAccessToken [-ResourceTypeName] [-ResourceUrl] [-Decoded] [-Scopes] [-Connection <PnPConnection>]
Get-PnPAccessToken -ResourceUrl <String> [-Decoded] [-Scopes] [-Connection <PnPConnection>]
```

### List Permission Scopes in current access token

```powershell
Get-PnPAccessToken -ListPermissionScopes [-ResourceTypeName <String>]
```


## DESCRIPTION
Gets the OAuth 2.0 Access Token.
Returns the OAuth 2.0 Access Token.

## EXAMPLES

Expand Down Expand Up @@ -59,6 +80,13 @@ Get-PnPAccessToken -ResourceUrl "https://management.azure.com/.default"

Gets the OAuth 2.0 Access Token to consume the SharePoint APIs and perform CSOM operations.

### EXAMPLE 6
```powershell
Get-PnPAccessToken -ListPermissionScopes
```

Lists the current permission scopes for the Microsoft Graph API on the access token. Specify -ResourceTypeName to list permissions for other resource types, like SharePoint.

## PARAMETERS

### -ResourceTypeName
Expand Down Expand Up @@ -132,6 +160,19 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -ListPermissionScopes
If specified the current permission scopes on the access token will be listed
```yaml
Type: SwitchParameter
Parameters Set: List Permission Scopes
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
105 changes: 105 additions & 0 deletions documentation/Get-PnPCopilotAgent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
document type: cmdlet
external help file: PnP.PowerShell.dll-Help.xml
HelpUri: ''
Locale: en-US
Module Name: PnP.PowerShell
ms.date: 12/06/2024
PlatyPS schema version: 2024-05-01
title: Get-PnPCopilotAgent
---

# Get-PnPCopilotAgent

## SYNOPSIS

Returns the Microsoft Copilot Agents (*.agent) in a site collection.

## SYNTAX

### __AllParameterSets

```powershell
Get-PnPCopilotAgent [-ServerRelativeUrl <string>] [-Connection <PnPConnection>] [<CommonParameters>]
```

## DESCRIPTION

This cmdlet iterates through the document libraries in a site and finds the copilot agents in that site.

## EXAMPLES

### Example 1

```powershell
Get-PnPCopilotAgent
```

This will return all the Microsoft Copilot agents in a site.


### Example 2

```powershell
Get-PnPCopilotAgent -ServerRelativeUrl /sites/demo/siteassets/copilots/approved/main.agent
```

This will return the specific Microsoft Copilot agent if it exists.


## PARAMETERS

### -Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

```yaml
Type: PnP.PowerShell.Commands.Base.PnPConnection
DefaultValue: ''
SupportsWildcards: false
ParameterValue: []
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```
### -ServerRelativeUrl
The server relative URL to the .agent file.
```yaml
Type: System.String
DefaultValue: ''
SupportsWildcards: false
ParameterValue: []
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
21 changes: 21 additions & 0 deletions documentation/Get-PnPFileInFolder.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ Get-PnPFileInFolder [-FolderSiteRelativeUrl <String>] [-ItemName <String>] [-Rec
Get-PnPFileInFolder [-Identity <FolderPipeBind>] [-ItemName <String>] [-Recurse] [-Includes <String[]>] [-ExcludeSystemFolders] [-Verbose] [-Connection <PnPConnection>]
```

### Folder via list pipebind
```powershell
Get-PnPFileInFolder [-List <ListPipeBind>] [-ItemType <String>] [-ItemName <String>] [-Includes <String[]>] [-Verbose] [-Connection <PnPConnection>]
```

## DESCRIPTION

This cmdlet allows listing of all the files in a folder. It can optionally also list all files in the underlying subfolders.

When working with a document library containing over 5,000 items in it, you will need to use the -List parameter to specify the document library in order to be able to retrieve the files in it. It will always recursively retrieve all files in the document library. You can also use -Includes to fetch additional properties of the files.

## EXAMPLES

### EXAMPLE 1
Expand Down Expand Up @@ -165,6 +172,20 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -List
The document library to retrieve the files from. This parameter is required when working with document libraries containing over 5,000 items.
```yaml
Type: ListPipeBind
Parameter Sets: Folder via list pipebind

Required: False
Position: 0
Default value: None
Accept pipeline input: True
Accept wildcard characters: False
```
### -Recurse
A switch parameter to include files of all subfolders in the specified folder
Expand Down
58 changes: 58 additions & 0 deletions documentation/Get-PnPFileRetentionLabel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPFileRetentionLabel.html
external help file: PnP.PowerShell.dll-Help.xml
title: Get-PnPFileRetentionLabel
---

# Get-PnPFileRetentionLabel

## SYNOPSIS

**Required Permissions**

* Microsoft Graph API : One of Files.Read.All, Sites.Read.All, Files.ReadWrite.All, Sites.ReadWrite.All

Retrieves the retention label information for a file in SharePoint.

## SYNTAX
```powershell
Get-PnPFileRetentionLabel -Url <String>
```

## DESCRIPTION

The Get-PnPFileRetentionLabel cmdlet retrieves the retention label information for a file in SharePoint using Microsoft Graph. It takes a URL as input, decodes it, and specifically encodes the '+' character if it is part of the filename.

## EXAMPLES

### Example 1
This example retrieves the retention label information for the file at the specified URL.

```powershell
Get-PnPFileRetentionLabel -Url "/sites/Marketing/Shared Documents/Report.pptx"
```

This example retrieves the retention label information for the file at the specified URL.

## PARAMETERS

### -Url
Specifies the URL of the file for which to retrieve the retention label information.

```yaml
Type: String
Parameter Sets: (All)

Required: True
Position: Named
Default value: None
Accept pipeline input: True
Accept wildcard characters: False
```
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
21 changes: 21 additions & 0 deletions documentation/Get-PnPFolderInFolder.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ Get-PnPFolderInFolder [-FolderSiteRelativeUrl <String>] [-ItemName <String>] [-E
Get-PnPFolderInFolder [-Identity <FolderPipeBind>] [-ItemName <String>] [-ExcludeSystemFolders] [-Includes <String[]>] [-Recurse] [-Verbose] [-Connection <PnPConnection>]
```

### Folder via list pipebind
```powershell
Get-PnPFolderInFolder [-List <ListPipeBind>] [-ItemType <String>] [-ItemName <String>] [-Includes <String[]>] [-Verbose] [-Connection <PnPConnection>]
```

## DESCRIPTION

This cmdlet allows listing of all the subfolders of a folder. It can optionally also list all folders in the underlying subfolders.

When working with a document library containing over 5,000 items in it, you will need to use the -List parameter to specify the document library in order to be able to retrieve the Folders in it. It will always recursively retrieve all folders in the document library. You can also use -Includes to fetch additional properties of the folders.

## EXAMPLES

### EXAMPLE 1
Expand Down Expand Up @@ -165,6 +172,20 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -List
The document library to retrieve the folders from. This parameter is required when working with document libraries containing over 5,000 items.
```yaml
Type: ListPipeBind
Parameter Sets: Folder via list pipebind

Required: False
Position: 0
Default value: None
Accept pipeline input: True
Accept wildcard characters: False
```
### -Recurse
A switch parameter to include folders of all subfolders in the specified folder
Expand Down
Loading

0 comments on commit 613609c

Please sign in to comment.