Skip to content

Commit

Permalink
Feature: bump to .NET 6 (#2292)
Browse files Browse the repository at this point in the history
* Bump to .net 6

* Bumps to dependencies for .net 6

* Added additional metadata

* Updated to .NET6 build

* Added backward compatibility for older runtime

* Bump deps

* Fix deps

* Fix PnP framework path

* Fix docker doc file

* Removing reference to Microsoft.Extensions.Logging.Abstractions

* Update nightlyrelease.yml

* Update README.md

It's actually 670 cmdlets :-)

Co-authored-by: Koen Zomers <koen@zomers.eu>
Co-authored-by: Erwin van Hunen <erwinvanhunen@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 4, 2022
1 parent 81c6831 commit 4098793
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/nightlyrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
dotnet-version: |
3.1.301
5.x
6.x
7.x
- uses: actions/checkout@v2
with:
ref: dev
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 over 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 6 / .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
2 changes: 1 addition & 1 deletion build/Build-Debug.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ else {
$buildVersion = $versionObject.Patch + 1;
}

$configuration = "netcoreapp3.1"
$configuration = "net6.0-windows"

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

Expand Down
2 changes: 1 addition & 1 deletion build/Build-Nightly.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ if ($runPublish -eq $true) {
$commonFiles = [System.Collections.Generic.Hashset[string]]::new()
Copy-Item -Path "$PSscriptRoot/../resources/*.ps1xml" -Destination "$destinationFolder"
Get-ChildItem -Path "$PSScriptRoot/../src/ALC/bin/Release/netstandard2.0" | Where-Object { $_.Extension -in '.dll', '.pdb' } | Foreach-Object { if (!$assemblyExceptions.Contains($_.Name)) { [void]$commonFiles.Add($_.Name) }; Copy-Item -LiteralPath $_.FullName -Destination $commonPath }
Get-ChildItem -Path "$PSScriptRoot/../src/Commands/bin/Release/netcoreapp3.1" | Where-Object { $_.Extension -in '.dll', '.pdb' -and -not $commonFiles.Contains($_.Name) } | Foreach-Object { Copy-Item -LiteralPath $_.FullName -Destination $corePath }
Get-ChildItem -Path "$PSScriptRoot/../src/Commands/bin/Release/net6.0-windows" | Where-Object { $_.Extension -in '.dll', '.pdb' -and -not $commonFiles.Contains($_.Name) } | Foreach-Object { Copy-Item -LiteralPath $_.FullName -Destination $corePath }
if (!$IsLinux -and !$IsMacOs) {
Get-ChildItem -Path "$PSScriptRoot/../src/Commands/bin/Release/net462" | Where-Object { $_.Extension -in '.dll', '.pdb' -and -not $commonFiles.Contains($_.Name) } | Foreach-Object { Copy-Item -LiteralPath $_.FullName -Destination $frameworkPath }
}
Expand Down
4 changes: 2 additions & 2 deletions docker/hub.docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

**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.
**PnP PowerShell** is a .NET 6 / .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 All @@ -24,7 +24,7 @@ Last version | Last nightly version

## About this image

**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.
**PnP PowerShell** is a .NET 6/ .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.

## Usage examples

Expand Down
Binary file added nugeticon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Commands/Planner/AddPlannerTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected override void ExecuteCmdlet()
if (ParameterSpecified(nameof(AssignedTo)))
{
newTask.Assignments = new Dictionary<string, TaskAssignment>();
var chunks = AssignedTo.Chunk(20);
var chunks = BatchUtility.Chunk(AssignedTo, 20);
foreach (var chunk in chunks)
{
var userIds = BatchUtility.GetPropertyBatchedAsync(Connection, AccessToken, chunk.ToArray(), "/users/{0}", "id").GetAwaiter().GetResult();
Expand Down
103 changes: 81 additions & 22 deletions src/Commands/PnP.PowerShell.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<CopyRefAssembliesToPublishDirectory>true</CopyRefAssembliesToPublishDirectory>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<Authors>PnP.PowerShell</Authors>
<Copyright>PnP 2022</Copyright>
<Configurations>Debug;Release</Configurations>
<PnPFrameworkPath Condition="'$(PnPFrameworkPath)' == ''"></PnPFrameworkPath>
<PnPCoreSdkPath Condition="'$(PnPCoreSdkPath)' == ''"></PnPCoreSdkPath>
Expand All @@ -19,6 +20,12 @@
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<RepositoryUrl>https://github.com/pnp/powershell</RepositoryUrl>
<PackageProjectUrl>https://github.com/pnp/powershell</PackageProjectUrl>
<PackageTags>Microsoft 365; PowerShell; SharePoint; Teams; Graph; Azure AD</PackageTags>
<Description>PnP PowerShell is a .NET 6/ .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 &amp; Compliance, Azure Active Directory, and more.</Description>
<PackageIcon>nugeticon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<PropertyGroup Condition="'$(IsWindows)'=='true'">
Expand All @@ -43,13 +50,11 @@

<ItemGroup>
<PackageReference Include="AngleSharp" Version="0.14.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />

<PackageReference Include="Microsoft.Graph" Version="3.33.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.36.1" />
<PackageReference Include="Microsoft.SharePointOnline.CSOM" Version="16.1.*" />
<PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />

<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.12.2" />
<PackageReference Include="PnP.Framework" Version="1.11.*-*" Condition="'$(PnPFrameworkPath)' == '' and '$(IsRelease)' != '1'" />
<PackageReference Include="PnP.Framework" Version="1.11.*-*" Condition="'$(IsRelease)' == '1'" />

Expand All @@ -65,22 +70,16 @@
<!-- currently for the following packages we only refer to the nightlies -->
<!-- <PackageReference Include="PnP.Core.Transformation" Version="1.6.*-*" Condition="'$(PnPCoreSdkPath)' == '' and '$(IsRelease)' != '1'" />
<PackageReference Include="PnP.Core.Transformation" Version="*" Condition="'$(IsRelease)' == '1'" /> -->

<PackageReference Include="PnP.Core.Transformation" Version="1.8.*-*" />

<!-- <PackageReference Include="PnP.Core.Transformation.SharePoint" Version="1.6.*-*" Condition="'$(PnPCoreSdkPath)' == '' and '$(IsRelease)' != '1'" />
<PackageReference Include="PnP.Core.Transformation.SharePoint" Version="*" Condition="'$(IsRelease)' == '1'" /> -->
<PackageReference Include="PnP.Core.Transformation.SharePoint" Version="1.8.*-*" />
<PackageReference Include="PnP.Core.Transformation.SharePoint" Version="1.8.*-*" />

<PackageReference Include="PowerShellStandard.Library" Version="5.1.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.12.2" />
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="4.7.0" />
<PackageReference Include="System.Security.Cryptography.OpenSsl" Version="4.7.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="4.7.2" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="TextCopy" Version="4.3.1" />
<ProjectReference Include="..\ALC\PnP.PowerShell.ALC.csproj" />

</ItemGroup>
Expand All @@ -93,53 +92,113 @@

<ItemGroup Condition="'$(PnPCoreSdkPath)' != '' and '$(IsRelease)' != '1'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.1.1" />
<Reference Include="PnP.Core">
<Reference Include="PnP.Core" Condition="'$(TargetFramework)' == 'net6.0-windows'">
<HintPath>$(PnPCoreSdkPath)PnP.Core\bin\Debug\net6.0\PnP.Core.dll</HintPath>
<Private>true</Private>
<SpecificVersion>false</SpecificVersion>
</Reference>
<Reference Include="PnP.Core" Condition="'$(TargetFramework)' == 'net462'">
<HintPath>$(PnPCoreSdkPath)PnP.Core\bin\Debug\netstandard2.0\PnP.Core.dll</HintPath>
<Private>true</Private>
<SpecificVersion>false</SpecificVersion>
</Reference>
<Reference Include="PnP.Core.Auth">
<Reference Include="PnP.Core.Auth" Condition="'$(TargetFramework)' == 'net6.0-windows'">
<HintPath>$(PnPCoreSdkPath)PnP.Core.Auth\bin\Debug\net6.0\PnP.Core.Auth.dll</HintPath>
<Private>true</Private>
<SpecificVersion>false</SpecificVersion>
</Reference>
<Reference Include="PnP.Core.Auth" Condition="'$(TargetFramework)' == 'net462'">
<HintPath>$(PnPCoreSdkPath)PnP.Core.Auth\bin\Debug\netstandard2.0\PnP.Core.Auth.dll</HintPath>
<Private>true</Private>
<SpecificVersion>false</SpecificVersion>
</Reference>
<Reference Include="PnP.Core.Admin">
<Reference Include="PnP.Core.Admin" Condition="'$(TargetFramework)' == 'net6.0-windows'">
<HintPath>$(PnPCoreSdkPath)PnP.Core.Admin\bin\Debug\net6.0\PnP.Core.Admin.dll</HintPath>
<Private>true</Private>
<SpecificVersion>false</SpecificVersion>
</Reference>
<Reference Include="PnP.Core.Admin" Condition="'$(TargetFramework)' == 'net462'">
<HintPath>$(PnPCoreSdkPath)PnP.Core.Admin\bin\Debug\netstandard2.0\PnP.Core.Admin.dll</HintPath>
<Private>true</Private>
<SpecificVersion>false</SpecificVersion>
</Reference>
<Reference Include="PnP.Core.Transformation">
<Reference Include="PnP.Core.Transformation" Condition="'$(TargetFramework)' == 'net6.0-windows'">
<HintPath>$(PnPCoreSdkPath)PnP.Core.Transformation\bin\Debug\net6.0\PnP.Core.Transformation.dll</HintPath>
<Private>true</Private>
<SpecificVersion>false</SpecificVersion>
</Reference>
<Reference Include="PnP.Core.Transformation" Condition="'$(TargetFramework)' == 'net462'">
<HintPath>$(PnPCoreSdkPath)PnP.Core.Transformation\bin\Debug\netstandard2.0\PnP.Core.Transformation.dll</HintPath>
<Private>true</Private>
<SpecificVersion>false</SpecificVersion>
</Reference>
<Reference Include="PnP.Core.Transformation.SharePoint">
<Reference Include="PnP.Core.Transformation.SharePoint" Condition="'$(TargetFramework)' == 'net6.0-windows'">
<HintPath>$(PnPCoreSdkPath)PnP.Core.Transformation.SharePoint\bin\Debug\net6.0\PnP.Core.Transformation.SharePoint.dll</HintPath>
<Private>true</Private>
<SpecificVersion>false</SpecificVersion>
</Reference>
<Reference Include="PnP.Core.Transformation.SharePoint" Condition="'$(TargetFramework)' == 'net462'">
<HintPath>$(PnPCoreSdkPath)PnP.Core.Transformation.SharePoint\bin\Debug\netstandard2.0\PnP.Core.Transformation.SharePoint.dll</HintPath>
<Private>true</Private>
<SpecificVersion>false</SpecificVersion>
</Reference>
</ItemGroup>

<ItemGroup Condition="'$(PnPFrameworkPath)' != '' and '$(IsRelease)' != '1'">
<Reference Include="PnP.Framework">
<Reference Include="PnP.Framework" Condition="'$(TargetFramework)' == 'net6.0-windows'">
<HintPath>$(PnPFrameworkPath)PnP.Framework\bin\Debug\net6.0\PnP.Framework.dll</HintPath>
<Private>true</Private>
<SpecificVersion>false</SpecificVersion>
</Reference>
<Reference Include="PnP.Framework" Condition="'$(TargetFramework)' == 'net462'">
<HintPath>$(PnPFrameworkPath)PnP.Framework\bin\Debug\netstandard2.0\PnP.Framework.dll</HintPath>
<Private>true</Private>
<SpecificVersion>false</SpecificVersion>
</Reference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="System.Management.Automation" Version="7.0.3" />
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="6.0.0" />
<PackageReference Include="System.Security.Cryptography.OpenSsl" Version="5.0.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="6.0.0" />
<PackageReference Include="System.Management.Automation" Version="7.2.0" />
<PackageReference Include="System.Text.Json" Version="6.0.7" />
<PackageReference Include="TextCopy" Version="6.1.0" />

</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="Microsoft.PowerShell.5.ReferenceAssemblies" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="4.7.0" />
<PackageReference Include="System.Security.Cryptography.OpenSsl" Version="4.7.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="4.7.2" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="TextCopy" Version="4.3.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Compile Remove="Base\DependencyAssemblyLoadContext.cs" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\nugeticon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Sdk.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<Sdk Name="Microsoft.NET.Sdk" />
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0-windows</TargetFrameworks>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Commands/WindowsSdk.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<Sdk Name="Microsoft.NET.Sdk.WindowsDesktop" />
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
</Project>
6 changes: 3 additions & 3 deletions src/Commands/_debug/debug.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ $BinPath = "$ProjectPath\bin\Debug"

$dlls = @("PnP.PowerShell.ALC.dll", "PnP.PowerShell.dll")

$netversion = "netcoreapp3.1"
$netversion = "net6.0-windows"

if ($PSEdition -eq 'Core') {
$netversion = "netcoreapp3.1"
if ($PSEdition -eq 'Core') {
$netversion = "net6.0-windows"
}
else {
$netversion = "net462"
Expand Down
2 changes: 1 addition & 1 deletion src/Tests/PnP.PowerShell.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<AssemblyName>PnP.PowerShell.Tests</AssemblyName>
<RootNamespace>PnP.PowerShell.Tests</RootNamespace>
Expand Down

0 comments on commit 4098793

Please sign in to comment.