Skip to content

Commit

Permalink
Merge branch 'dev' into feature/1360
Browse files Browse the repository at this point in the history
  • Loading branch information
KoenZomers authored Jun 9, 2022
2 parents c4b5684 + 5f759ff commit 519fb58
Show file tree
Hide file tree
Showing 43 changed files with 1,279 additions and 311 deletions.
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,32 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `TimeZone` parameter to `New-PnPSite` cmdlet which allows setting of the site collection in the specified timezone.
- Added `Stop-PnPFlowRun` cmdlet to stop/cancel a specific Power Automate flow run. [#1838](https://github.com/pnp/powershell/pull/1838)
- Added `Remove-PnPTeamsChannelUser` cmdlet to remove a user from a private channel. [#1840](https://github.com/pnp/powershell/pull/1840)
- Added `Get-PnPListItemPermission` cmdlet to retrieve item level permissions. [#1534](https://github.com/pnp/powershell/pull/1534)
- Added `Get-PnPTeamsChannelMessageReply` to retrieve all replies or a specific reply of a message in a Teams channel [#1885](https://github.com/pnp/powershell/pull/1885)
- Added `-Identity` parameter to `Get-PnPTeamsChannelMessage` cmdlet to retrieve a specific message [#1887](https://github.com/pnp/powershell/pull/1887)
- Added new `PnP.PowerShell` image which also gets published to Docker Hub. [#1580](https://github.com/pnp/powershell/pull/1794)
- Added capability to Debug the module in Visual Studio. [#1880](https://github.com/pnp/powershell/pull/1880)
- Added `Set-PnPTeamsChannelUser` cmdlet to update the role of user in a private channel. [#1865](https://github.com/pnp/powershell/pull/1865)
- Added `Restart-PnPFlowRun` which allows for a failed Power Automate flow run to be retried [#1915](https://github.com/pnp/powershell/pull/1915)
- Added optional `-Connection` parameter to `Get-PnPConnection`, `Get-PnPContext` and `Set-PnPContext` which allows for using any of these for a specific connection [#1919](https://github.com/pnp/powershell/pull/1919)
- Added `-IncludeDeprecated` parameter to `Get-PnPTerm` cmdlet to fetch deprecated terms if specified [#1903](https://github.com/pnp/powershell/pull/1903)
- - Added `-IncludeContentType` parameter, which if specified will retrieve content type information of the list items. [#1921](https://github.com/pnp/powershell/pull/1921)
- Added `-IncludeContentType` parameter, which if specified will retrieve content type information of the list items. [#1921](https://github.com/pnp/powershell/pull/1921)
- Added optional `-ValidateConnection` to `Connect-PnPOnline` which will check if the site you are connecting to exists and if not, will throw an exception [#1924](https://github.com/pnp/powershell/pull/1924)
- Added `Add-PnPListItemAttachment` cmdlet to provide ability to upload a file as an attachment to a SharePoint list item. [#1932](https://github.com/pnp/powershell/pull/1932)
- Added `Remove-PnPListItemAttachment` cmdlet to provide ability to delete a list item attachment. [#1932](https://github.com/pnp/powershell/pull/1932)
- Added `Get-PnPListItemAttachment` cmdlet to download the attachments from a list item. [#1932](https://github.com/pnp/powershell/pull/1932)

### Changed
- Changed `Sync-PnPSharePointUserProfilesFromAzureActiveDirectory` to map users based on their Ids instead which should resolve some issues around user identities reporting not to exist. You can use the new `-IdType` option to switch it back to `PrincipalName` if needed. [#1752](https://github.com/pnp/powershell/pull/1752)
- Changed `Get-PnPOrgAssetsLibrary` to return a proper value of the organisation assets libraries. [#1889](https://github.com/pnp/powershell/pull/1889)
- Bumped .NET Framework version to 4.6.2 as the 4.6.1 is not supported anymore. [#1856](https://github.com/pnp/powershell/pull/1856)
- Changed `Add-PnPDataRowsToSiteTemplate`, it will now export a datetime field value as UTC string. [#1900](https://github.com/pnp/powershell/pull/1900)
- The cmdlets `Remove-PnPFile`, `Remove-PnPFolder`, `Move-PnPListItemToRecycleBin`, `Remove-PnPList`, `Remove-PnPListItem` and `Remove-PnPPage` will now return the corresponding recycle bin item if they get deleted to the recycle bin. Before they would not return anything. [#1783](https://github.com/pnp/powershell/pull/1783)
- Cmdlets backed by a Microsoft Graph call will now return detailed information when the Graph call fails [#1923](https://github.com/pnp/powershell/pull/1923)
- Changed `Get-PnPPlannerBucket` to return the buckets in the correct (reversed) order as you see them through the web interface [#1922](https://github.com/pnp/powershell/pull/1922)
- Changed `Connect-PnPOnline -Interactive` and `Connect-PnPOnline -DeviceLogin` to no longer suppress errors which should allow for certificate logins to be used. [#1933](https://github.com/pnp/powershell/pull/1933)
- `Set-PnPTeamsChannel` now uses the Graph v1 endpoint, previously it used the beta endpoint. [#1938](https://github.com/pnp/powershell/pull/1938)
- Service Health cmdlets have been improved, now are consistent with other cmdlets to handle pagination [#1938](https://github.com/pnp/powershell/pull/1938)

### Fixed

Expand All @@ -60,12 +71,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fixed `Invoke-PnPSPRestMethod` invalid parsing for SharePoint number columns. [#1877](https://github.com/pnp/powershell/pull/1879)
- Fix issue with `Add/Set-PnPListItem` not throwing correct exception for invalid taxonomy values. [#1870](https://github.com/pnp/powershell/pull/1870)
- Fixed `Sync-PnPSharePointUserProfilesFromAzureActiveDirectory` throwing an "Object reference not set to an instance of an object" exception when providing an empty users collection or incorrect user mapping [#1896](https://github.com/pnp/powershell/pull/1896)
- Fixed `Connect-PnPOnline -ReturnConnection` also setting the current connection instead of just the returned connection [#1919](https://github.com/pnp/powershell/pull/1919)
- Fixed `Disconnect-PnPOnline -Connection` also disconnecting other connections next to the provided connection [#1919](https://github.com/pnp/powershell/pull/1919)
- Fixed `Set-PnPContext` not properly applying the provided context [#1919](https://github.com/pnp/powershell/pull/1919)
- Fixed Graph endpoints for non-commercial clouds for Managed Identity and Teams cmdlets [#1944](https://github.com/pnp/powershell/pull/1944)
- Fixed `Add-PnPTeamsUser`, the parameter `-Channel` is now not required. [#1953](https://github.com/pnp/powershell/pull/1953)

### Removed
- Removed `Get-PnPAvailableClientSideComponents`. Use `Get-PnPPageComponent -Page -ListAvailable` instead. [#1833](https://github.com/pnp/powershell/pull/1833)
- Removed `NextLink` property from `Get-PnPAzureADUser` cmdlet, as it was causing confusion. [#1930](https://github.com/pnp/powershell/pull/1930)

### Contributors

- Yuriy Samorodov [YuriySamorodov]
- Arleta Wanat [PowershellScripts]
- Marc D Anderson [sympmarc]
- dc366 [dc366]
- Bart-Jan Dekker [bjdekker]
- Aleksandr Sapozhkov [shurick81]
Expand Down
176 changes: 176 additions & 0 deletions documentation/Add-PnPListItemAttachment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
---
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Add-PnPListItemAttachment.html
external help file: PnP.PowerShell.dll-Help.xml
title: Add-PnPListItemAttachment
---

# Add-PnPListItemAttachment

## SYNOPSIS
Adds an attachment to the specified list item in the SharePoint list

## SYNTAX

### Upload attachment file from path
```powershell
Add-PnPListItemAttachment [-List] <ListPipeBind> [-Identity] <ListItemPipeBind> [-Path <String>] [-NewFileName <String>] [-Connection <PnPConnection>] [<CommonParameters>]
```

### Upload attachment file from stream
```powershell
Add-PnPListItemAttachment [-List] <ListPipeBind> [-Identity] <ListItemPipeBind> [-FileName <String>] [-Stream <Stream>] [-Connection <PnPConnection>] [<CommonParameters>]
```

### Create attachment file from text
```powershell
Add-PnPListItemAttachment [-List] <ListPipeBind> [-Identity] <ListItemPipeBind> [-FileName <String>] [-Content <text>] [-Connection <PnPConnection>] [<CommonParameters>]
```

## DESCRIPTION

This cmdlet allows adding a file as an attachment to a list item in a SharePoint Online list.

## EXAMPLES

### EXAMPLE 1
```powershell
Add-PnPListItemAttachement -List "Demo List" -Identity 1 -Path c:\temp\test.mp4
```

Adds a new attachment to the list item with Id "1" in the "Demo List" SharePoint list with file name as test.mp4 from the specified path.


### EXAMPLE 2
```powershell
Add-PnPListItemAttachement -List "Demo List" -Identity 1 -FileName "test.txt" -Content '{ "Test": "Value" }'
```

Adds a new attachment to the list item with Id "1" in the "Demo List" SharePoint list with file name as test.txt and content as specified.

### EXAMPLE 3
```powershell
Add-PnPListItemAttachement -List "Demo List" -Identity 1 -FileName "test.mp4" -Stream $fileStream
```

Adds a new attachment to the list item with Id "1" in the "Demo List" SharePoint list with file name as test.mp4 and content coming from a stream.

## PARAMETERS

### -Content
Specify text of the attachment for the list item.

```yaml
Type: String
Parameter Sets: (Upload file from text)

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Path
The local file path
```yaml
Type: String
Parameter Sets: (Upload file)

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -NewFileName
Filename to give to the attachment file on SharePoint
```yaml
Type: String
Parameter Sets: (Upload file)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -FileName
Filename to give to the attachment file on SharePoint
```yaml
Type: String
Parameter Sets: (Upload file from stream, Upload file from text)

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Stream
Stream with the file contents
```yaml
Type: Stream
Parameter Sets: (Upload file from stream)

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -List
The ID, Title or Url of the list. Note that when providing the name of the list, the name is case-sensitive.
```yaml
Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -Identity
The ID of the listitem, or actual ListItem object to add the attachment to.
```yaml
Type: ListItemPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -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: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
13 changes: 12 additions & 1 deletion documentation/Add-PnPTeamsUser.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@ Adds a user to an existing Microsoft Teams instance.

## SYNTAX

### User
```powershell
Add-PnPTeamsUser -Team <TeamsTeamPipeBind> -Channel <TeamsChannelPipeBind> -User <String> -Role <String> [<CommonParameters>]
```

### Users
```powershell
Add-PnPTeamsUser -Team <TeamsTeamPipeBind> -Users <String[]> -Role <String> [<CommonParameters>]
```

## DESCRIPTION
This cmdlet adds one or more users to an existing Team.

## EXAMPLES

Expand All @@ -32,18 +39,22 @@ Add-PnPTeamsUser -Team <TeamsTeamPipeBind> -Channel <TeamsChannelPipeBind> -User
Add-PnPTeamsUser -Team MyTeam -User [email protected] -Role Owner
```

Adds a user as an owner to the team
Adds a user as an owner to the team.

### EXAMPLE 2
```powershell
Add-PnPTeamsUser -Team MyTeam -User [email protected] -Role Member
```

Adds a user as a member to the team.

### EXAMPLE 3
```powershell
Add-PnPTeamsUser -Team MyTeam -Users "[email protected]","[email protected]" -Role Member
```

Adds multiple users as members to the team.

### EXAMPLE 4
```powershell
Add-PnPTeamsUser -Team MyTeam -User "[email protected]" -Role Member -Channel Private
Expand Down
44 changes: 36 additions & 8 deletions documentation/Connect-PnPOnline.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,49 +17,50 @@ Connect to a SharePoint site
Connect-PnPOnline [-ReturnConnection] [-Url] <String> [-Credentials <CredentialPipeBind>] [-CurrentCredentials]
[-CreateDrive] [-DriveName <String>] [-ClientId <String>] [-RedirectUri <String>]
[-AzureEnvironment <AzureEnvironment>] [-TenantAdminUrl <String>]
[-TransformationOnPrem] [<CommonParameters>]
[-TransformationOnPrem] [-ValidateConnection] [<CommonParameters>]
```

### SharePoint ACS (Legacy) App Only
```
Connect-PnPOnline [-ReturnConnection] [-Url] <String> [-Realm <String>] -ClientSecret <String> [-CreateDrive]
[-DriveName <String>] -ClientId <String> [-AzureEnvironment <AzureEnvironment>] [-TenantAdminUrl <String>]
[<CommonParameters>]
[-ValidateConnection] [<CommonParameters>]
```

### App-Only with Azure Active Directory
```
Connect-PnPOnline [-ReturnConnection] [-Url] <String> [-CreateDrive] [-DriveName <String>] -ClientId <String>
-Tenant <String> [-CertificatePath <String>] [-CertificateBase64Encoded <String>]
[-CertificatePassword <SecureString>] [-AzureEnvironment <AzureEnvironment>] [-TenantAdminUrl <String>]
[<CommonParameters>]
[-ValidateConnection] [<CommonParameters>]
```

### App-Only with Azure Active Directory using a certificate from the Windows Certificate Management Store by thumbprint
```
Connect-PnPOnline [-ReturnConnection] [-Url] <String> [-CreateDrive] [-DriveName <String>] -ClientId <String>
-Tenant <String> -Thumbprint <String> [-AzureEnvironment <AzureEnvironment>] [-TenantAdminUrl <String>]
[<CommonParameters>]
[-ValidateConnection] [<CommonParameters>]
```

### PnP Management Shell / DeviceLogin
```
Connect-PnPOnline [-ReturnConnection] [-Url] <String> [-CreateDrive] [-DriveName <String>] [-DeviceLogin]
[-LaunchBrowser] [-ClientId <String>] [-AzureEnvironment <AzureEnvironment>]
[<CommonParameters>]
[-ValidateConnection] [<CommonParameters>]
```

### Web Login for Multi Factor Authentication
```
Connect-PnPOnline [-ReturnConnection] [-Url] <String> [-CreateDrive] [-DriveName <String>]
[-TenantAdminUrl <String>] [-UseWebLogin] [-ForceAuthentication]
[<CommonParameters>]
[-ValidateConnection] [<CommonParameters>]
```

### Interactive for Multi Factor Authentication
```
Connect-PnPOnline -Interactive [-ReturnConnection] -Url <String> [-CreateDrive] [-DriveName <String>] [-LaunchBrowser]
[-ClientId <String>] [-AzureEnvironment <AzureEnvironment>] [-TenantAdminUrl <String>] [-ForceAuthentication] [<CommonParameters>]
[-ClientId <String>] [-AzureEnvironment <AzureEnvironment>] [-TenantAdminUrl <String>] [-ForceAuthentication] [-ValidateConnection]
[<CommonParameters>]
```

### On-premises login for page transformation from on-premises SharePoint to SharePoint Online
Expand Down Expand Up @@ -517,6 +518,20 @@ Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -ValidateConnection
When provided, the cmdlet will check to ensure the SharePoint Online site specified through `-Url` exists and if not, will throw an exception. If you omit this flag or set it to $false, it will blindly set up a connection without validating that the site actually exists. Making use of this option does make one extra call on the connection attempt, so it is recommended to only use it in scenarios where you know the site you're trying to connect o may not exist and would like to have feedback on this during the connect.

```yaml
Type: SwitchParameter
Parameter Sets: Credentials, SharePoint ACS (Legacy) App Only, App-Only with Azure Active Directory, App-Only with Azure Active Directory using a certificate from the Windows Certificate Management Store by thumbprint, SPO Management Shell Credentials, PnP Management Shell / DeviceLogin, Web Login for Multi Factor Authentication, Interactive for Multi Factor Authentication, Access Token
Aliases:
Required: False
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -TransformationOnPrem
If you want to the use page transformation cmdlets, setting this switch will allow you to connect to an on-prem server.
Notice that this -only- applies to Transformation cmdlets.
Expand Down Expand Up @@ -617,7 +632,20 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -Verbose
When provided, additional debug statements will be shown while going through setting up a connection.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

## RELATED LINKS

[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
Loading

0 comments on commit 519fb58

Please sign in to comment.