Skip to content

Commit

Permalink
Merge pull request #2546 from pnp/dev
Browse files Browse the repository at this point in the history
November 2022 Release
  • Loading branch information
erwinvanhunen authored Nov 10, 2022
2 parents 8fbb9f1 + 61e76cb commit 9be73c3
Show file tree
Hide file tree
Showing 575 changed files with 335,717 additions and 2,077 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/buildpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,20 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
dotnet-version: |
6.0.x
7.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:PnPCoreSdkPathNet5="..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net5.0\PnP.Core.dll" -p:PnPCoreSdkPathNet6="..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net6.0\PnP.Core.dll"
run: dotnet restore -p:PnPCoreSdkPath="..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\netstandard2.0\PnP.Core.dll" -p:PnPCoreSdkPathNet5="..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net5.0\PnP.Core.dll" -p:PnPCoreSdkPathNet6="..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net6.0\PnP.Core.dll" -p:PnPCoreSdkPathNet7="..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net7.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:PnPCoreSdkPathNet5="..\..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net5.0\PnP.Core.dll" -p:PnPCoreSdkPathNet6="..\..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net6.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:PnPCoreSdkPathNet5="..\..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net5.0\PnP.Core.dll" -p:PnPCoreSdkPathNet6="..\..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net6.0\PnP.Core.dll" -p:PnPCoreSdkPathNet7="..\..\..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\net7.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
130 changes: 128 additions & 2 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To debug the cmdlets: launch PowerShell and attach Visual Studio to the powershe
Before starting on any new submissions, please ensure your fork is up to date with the upstream repository. This avoids frustration and challenges for us to validate and test your submission. Steps on how to easily keep your fork up to date can be found [on this wiki page](https://github.com/pnp/PnP-PowerShell/wiki/Update-your-fork-with-the-latest-code).

## Code contributions
In order to successfully compile the PnP PowerShell solution you will _also_ have to download *and build in Visual Studio* the [PnP-Framework](https://github.com/pnpframework) repository and make the dev branch available. **The PowerShell solution depends on it**. In order to successfully
In order to successfully compile the PnP PowerShell solution you will _also_ have to download *and build in Visual Studio* the [PnP-Framework](https://github.com/pnp/pnpframework) repository and make the dev branch available. **The PowerShell solution depends on it**. In order to successfully
compile it, make sure that PnP-Sites-Core is located at the same level as PnP-PowerShell and you open the solution file `pnpframework.sln` located in the Core subfolder of the sourcecode.

So:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PnP PowerShell

**PnP PowerShell** is a .NET Core 3.1 / .NET Framework 4.6.2 based PowerShell Module providing nearly 650 cmdlets that work with Microsoft 365 environments such as SharePoint Online, Microsoft Teams, Microsoft Project, Security & Compliance, Azure Active Directory, and more.
**PnP PowerShell** is a .NET Core 3.1 / .NET Framework 4.6.2 based PowerShell Module providing over 650 cmdlets that work with Microsoft 365 environments such as SharePoint Online, Microsoft Teams, Microsoft Project, Security & Compliance, Azure Active Directory, and more.

Last version | Last nightly version
-------------|---------------------
Expand Down
3 changes: 3 additions & 0 deletions build/Build-Nightly.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ if ($runPublish -eq $true) {
exit 1
}

# Generate predictor commands
./build/Generate-PredictorCommands.ps1 -Version $version

Write-Host "Generating Documentation" -ForegroundColor Yellow
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module PlatyPS -ErrorAction Stop
Expand Down
76 changes: 76 additions & 0 deletions build/Generate-PredictorCommands.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
Param(
[Parameter(Mandatory = $true)]
[String]
$Version
)

try {

Write-Host "Generating PnP.PowerShell predictor commands for version $Version" -ForegroundColor Yellow

$json = @();

# get all files in the srcfiles folder
$files = Get-ChildItem -Path ".\documentation" -Filter "*.md" -Recurse;

# set id to 1
$id = 1;

# loop through each file
$files | ForEach-Object {

# get file name without extension
$baseName = $_.BaseName;

# get the file data
$fileData = Get-Content $_.FullName -Raw;
# create a regex pattern to match the example code
$pattern = "(?s)(?<=### EXAMPLE .*``````powershell)(.*?)(?=``````)"

if($baseName -eq "connect-pnponline") {
$pattern = "(?s)(?<=### EXAMPLE .*``````)(.*?)(?=``````)";
}

# ignore case for regex
$options = [Text.RegularExpressions.RegexOptions]'IgnoreCase, CultureInvariant'

$result = [regex]::Matches($fileData, $pattern, $options);

$i = 1;
foreach ($item in $result) {

$value = $item.Value.Trim();

# replace \n with a semicolon
$value = $value.Replace("`n", " ; ");


# if the item value begins with the name of the file then add it to the json
if ($value.ToLower() -match "^$($baseName.ToLower()).*") {
$json += @{
"CommandName" = $baseName
"Command" = $value
"Rank" = $i
"Id" = $id
}
$i++;
$id++;
}
}

}

# check if predictor folder exists in ..\resources folder
if (!(Test-Path -Path ".\resources\predictor")) {
# create the folder
New-Item -ItemType Directory -Path ".\resources\predictor" -Force;
}

# write the json to a file
$json | ConvertTo-Json -Depth 10 | Out-File -FilePath ".\resources\predictor\PnP.PowerShell.Suggestions.$($Version).json" -Encoding UTF8 -Force;
}
catch {
Write-Error $_.Exception.Message;
Write-Error "Error: Cannot generate predictor commands";
exit 1;
}
42 changes: 31 additions & 11 deletions docker/hub.docker.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# PnP.Powershell

## Featured tags
![PnP PowerShell](https://repository-images.githubusercontent.com/296298081/933a6d00-072b-11eb-839d-56df16c29588)

### Latest
**PnP PowerShell** is a .NET Core 3.1 / .NET Framework 4.6.2 based PowerShell Module providing over 650 cmdlets that work with Microsoft 365 environments such as SharePoint Online, Microsoft Teams, Microsoft Project, Security & Compliance, Azure Active Directory, and more.

Last version | Last nightly version
-------------|---------------------
[![PnP.PowerShell](https://img.shields.io/powershellgallery/v/pnp.powershell)](https://www.powershellgallery.com/packages/PnP.PowerShell/) | [![PnP.PowerShell](https://img.shields.io/powershellgallery/v/pnp.powershell?include_prereleases)](https://www.powershellgallery.com/packages/PnP.PowerShell/)

## Latest

* latest: The latest stable image

Expand All @@ -18,29 +24,29 @@

## About this image

**PnP PowerShell** is a .NET Core 3.1 / .NET Framework 4.6.1 based PowerShell Module providing over 600 cmdlets that work with Microsoft 365 environments such as SharePoint Online, Microsoft Teams, Microsoft Project, Security & Compliance, Azure Active Directory, and more.
**PnP PowerShell** is a .NET Core 3.1/ .NET Framework 4.6.2 based PowerShell Module providing over 600 cmdlets that work with Microsoft 365 environments such as SharePoint Online, Microsoft Teams, Microsoft Project, Security & Compliance, Azure Active Directory, and more.

## Usage examples

### Windows-container

Starting an isolated container with PnP.PowerShell module installed:

```
docker run --rm -it m365pnp/powershell:1.10.0-nanoserver-1809
```powershell
docker run --rm -it m365pnp/powershell:1.11.0-nanoserver-1809
```

Starting a PnP.PowerShell container with the current directory mounted:

```PowerShell
docker run --rm -it -v ${PWD}:c:/app -w c:/app m365pnp/powershell:1.10.0-nanoserver-1809
```powerShell
docker run --rm -it -v ${PWD}:c:/app -w c:/app m365pnp/powershell:1.11.0-nanoserver-1809
```

### Linux-container

Starting an isolated container with PnP.PowerShell module installed:

```
```powershell
docker run --rm -it m365pnp/powershell
```

Expand Down Expand Up @@ -69,9 +75,23 @@ Tag name examples:
* 1.10.0-nanoserver-1809
* 1.10.0-alpine-3.14
* 1.10.26-nightly-nanoserver-ltsc2022
* 1.11.0-alpine-3.14
* 1.11.0-nanoserver-ltsc2022

To find the version numbers please visit <https://www.powershellgallery.com/packages/PnP.PowerShell>

## Contribute

We love to accept contributions.

If you want to get involved with helping us grow PnP PowerShell, whether that is suggesting or adding a new cmdlet, extending an existing cmdlet or updating our documentation, we would love to hear from you.

Checkout our [Wiki](https://pnp.github.io/powershell/articles/buildingsource.html) for guides on how to contribute to this project.

## Microsoft 365 Platform Community

To find the version numbers please visit https://www.powershellgallery.com/packages/PnP.PowerShell
PnP PowerShell is a [Microsoft 365 Platform Community](https://pnp.github.io) (PnP) project. Microsoft 365 Platform Community is a virtual team consisting of Microsoft employees and community members focused on helping the community make the best use of Microsoft products. PnP PowerShell is an open-source project not affiliated with Microsoft and not covered by Microsoft support. If you experience any issues using PnP PowerShell, please submit an issue or open a discussion in the [issues list or discussion forum](https://github.com/pnp/powershell/issues/new/choose).

## Feedback
## Disclaimer

* To give feedback for PnP.PowerShell or for how the images are built, file an issue at [PnP/PowerShell](https://github.com/pnp/powershell/issues/new/choose)
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
14 changes: 13 additions & 1 deletion documentation/Add-PnPAlert.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Adds an alert for a user to a list
```powershell
Add-PnPAlert [-List] <ListPipeBind> [-Title <String>] [-User <UserPipeBind>]
[-DeliveryMethod <AlertDeliveryChannel>] [-ChangeType <AlertEventType>] [-Frequency <AlertFrequency>]
[-Filter <AlertFilter>] [-Time <DateTime>] [-Connection <PnPConnection>]
[-Filter <AlertFilter>] [-Time <DateTime>] [-AlertTemplateName <string>] [-Connection <PnPConnection>]
[<CommonParameters>]
```

Expand Down Expand Up @@ -179,7 +179,19 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -AlertTemplateName
To define a particular alert template. Refer this [link](https://learn.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/bb802738(v=office.14)) to specify the template value name.
```yaml
Type: string
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
## RELATED LINKS
Expand Down
24 changes: 16 additions & 8 deletions documentation/Add-PnPApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,23 @@ Add-PnPApp [-Path] <String> [-Scope <AppCatalogScope>] [-Overwrite] [-Timeout <I

## DESCRIPTION

Allows to upload an app to the app catalog at tenant or site collection level. By specifying `-Publish` option it is possible to deploy/trust it at the same time.

## EXAMPLES

### EXAMPLE 1
```powershell
Add-PnPApp -Path ./myapp.sppkg
```

This will upload the specified app package to the app catalog
This will upload the specified app package to the tenant app catalog

### EXAMPLE 2
```powershell
Add-PnPApp -Path ./myapp.sppkg -Publish
```

This will upload the specified app package to the app catalog and deploy/trust it at the same time.
This will upload the specified app package to the tenant app catalog and deploy/trust it at the same time.

### EXAMPLE 3
```powershell
Expand All @@ -44,6 +46,13 @@ Add-PnPApp -Path ./myapp.sppkg -Scope Site -Publish

This will upload the specified app package to the site collection app catalog and deploy/trust it at the same time.

### EXAMPLE 4
```powershell
Add-PnPApp -Path ./myapp.sppkg -Publish -SkipFeatureDeployment
```

This will upload the specified app package to the tenant app catalog, deploy/trust it and make it globally available on all site collections.

## PARAMETERS

### -Connection
Expand All @@ -60,7 +69,7 @@ Accept wildcard characters: False
```
### -Overwrite
Overwrites the existing app package if it already exists
When provided, it will overwrite the existing app package if it already exists
```yaml
Type: SwitchParameter
Expand All @@ -73,7 +82,7 @@ Accept wildcard characters: False
```
### -Path
Specifies the Id or an actual app metadata instance
The path to the app package to deploy to the App Catalog
```yaml
Type: String
Expand All @@ -86,7 +95,7 @@ Accept wildcard characters: False
```
### -Publish
This will deploy/trust an app into the app catalog
This will deploy/trust an app into the App Catalog
```yaml
Type: SwitchParameter
Expand All @@ -99,7 +108,7 @@ Accept wildcard characters: False
```
### -Scope
Defines which app catalog to use. Defaults to Tenant
Defines which app catalog to use: the site collection scoped App Catalog or the tenant wide App Catalog. Defaults to Tenant.
```yaml
Type: AppCatalogScope
Expand All @@ -113,6 +122,7 @@ Accept wildcard characters: False
```
### -SkipFeatureDeployment
When provided, the solution will be globally deployed, meaning one does not have to go into every site to add it as an app to have its components available. Instead they will be available rightaway.
```yaml
Type: SwitchParameter
Expand Down Expand Up @@ -140,5 +150,3 @@ Accept wildcard characters: False
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
2 changes: 2 additions & 0 deletions documentation/Add-PnPAvailableSiteClassification.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Add-PnPAvailableSiteClassification -Classifications <System.Collections.Generic.

## DESCRIPTION

Allows to add classic site classification values

## EXAMPLES

### EXAMPLE 1
Expand Down
2 changes: 2 additions & 0 deletions documentation/Add-PnPAzureADGroupMember.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Add-PnPAzureADGroupMember -Identity <AzureADGroupPipeBind> -Users <String[]> [-R

## DESCRIPTION

Allows to add users to Azure Active Directory Group. This can be a security, distribution or Microsoft 365 group. By specifying `-RemoveExisting` option it is possible to first clear the group of all existing members.

## EXAMPLES

### EXAMPLE 1
Expand Down
2 changes: 2 additions & 0 deletions documentation/Add-PnPAzureADGroupOwner.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Add-PnPAzureADGroupOwner -Identity <AzureADGroupPipeBind> -Users <String[]> [-Re

## DESCRIPTION

Allows to add users to owners of an Azure Active Directory Group. This can be a security, distribution or Microsoft 365 group. By specifying `-RemoveExisting` option it is possible to first clear the group of all existing members.

## EXAMPLES

### EXAMPLE 1
Expand Down
2 changes: 2 additions & 0 deletions documentation/Add-PnPContentTypeToDocumentSet.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Add-PnPContentTypeToDocumentSet -ContentType <ContentTypePipeBind[]> -DocumentSe

## DESCRIPTION

Allows to add content type to document set.

## EXAMPLES

### EXAMPLE 1
Expand Down
2 changes: 2 additions & 0 deletions documentation/Add-PnPContentTypeToList.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Add-PnPContentTypeToList -List <ListPipeBind> -ContentType <ContentTypePipeBind>

## DESCRIPTION

Allows to add content type to list. By specifying `-DefaultContentType` option it is possible set the newly added content type as default.

## EXAMPLES

### EXAMPLE 1
Expand Down
2 changes: 2 additions & 0 deletions documentation/Add-PnPContentTypesFromContentTypeHub.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Add-PnPContentTypesFromContentTypeHub -ContentTypes List<String> [-Site <SitePip

## DESCRIPTION

Allows to add content types from content type hub site to current site. In case the same content type is already present on the current site then the latest published version will be used.

## EXAMPLES

### EXAMPLE 1
Expand Down
1 change: 1 addition & 0 deletions documentation/Add-PnPDataRowsToSiteTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Add-PnPDataRowsToSiteTemplate [-Path] <String> -List <ListPipeBind> [-Query <Str
```

## DESCRIPTION
Allows to add datarows to list inside a PnP Provisioning Template. The command allows to specify the fields which should be retrieved using `-Fields` option and filter the datarows to be used by using `-Query` option.

## EXAMPLES

Expand Down
1 change: 1 addition & 0 deletions documentation/Add-PnPDocumentSet.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Add-PnPDocumentSet -List <ListPipeBind> -Name <String> -ContentType <ContentType
```

## DESCRIPTION
Allows to add new document set to library.

## EXAMPLES

Expand Down
Loading

0 comments on commit 9be73c3

Please sign in to comment.