Skip to content

Commit 4098793

Browse files
gautamdshethKoenZomerserwinvanhunen
authored
Feature: bump to .NET 6 (#2292)
* 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 <[email protected]> Co-authored-by: Erwin van Hunen <[email protected]>
1 parent 81c6831 commit 4098793

12 files changed

+95
-34
lines changed

.github/workflows/nightlyrelease.yml

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
dotnet-version: |
1717
3.1.301
1818
5.x
19+
6.x
20+
7.x
1921
- uses: actions/checkout@v2
2022
with:
2123
ref: dev

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PnP PowerShell
22

3-
**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.
3+
**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.
44

55
Last version | Last nightly version
66
-------------|---------------------

build/Build-Debug.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ else {
3535
$buildVersion = $versionObject.Patch + 1;
3636
}
3737

38-
$configuration = "netcoreapp3.1"
38+
$configuration = "net6.0-windows"
3939

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

build/Build-Nightly.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ if ($runPublish -eq $true) {
113113
$commonFiles = [System.Collections.Generic.Hashset[string]]::new()
114114
Copy-Item -Path "$PSscriptRoot/../resources/*.ps1xml" -Destination "$destinationFolder"
115115
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 }
116-
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 }
116+
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 }
117117
if (!$IsLinux -and !$IsMacOs) {
118118
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 }
119119
}

docker/hub.docker.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
**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.
5+
**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.
66

77
Last version | Last nightly version
88
-------------|---------------------
@@ -24,7 +24,7 @@ Last version | Last nightly version
2424

2525
## About this image
2626

27-
**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.
27+
**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.
2828

2929
## Usage examples
3030

nugeticon.png

52.6 KB
Loading

src/Commands/Planner/AddPlannerTask.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ protected override void ExecuteCmdlet()
9191
if (ParameterSpecified(nameof(AssignedTo)))
9292
{
9393
newTask.Assignments = new Dictionary<string, TaskAssignment>();
94-
var chunks = AssignedTo.Chunk(20);
94+
var chunks = BatchUtility.Chunk(AssignedTo, 20);
9595
foreach (var chunk in chunks)
9696
{
9797
var userIds = BatchUtility.GetPropertyBatchedAsync(Connection, AccessToken, chunk.ToArray(), "/users/{0}", "id").GetAwaiter().GetResult();

src/Commands/PnP.PowerShell.csproj

+81-22
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<CopyRefAssembliesToPublishDirectory>true</CopyRefAssembliesToPublishDirectory>
1111
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
1212
<Authors>PnP.PowerShell</Authors>
13+
<Copyright>PnP 2022</Copyright>
1314
<Configurations>Debug;Release</Configurations>
1415
<PnPFrameworkPath Condition="'$(PnPFrameworkPath)' == ''"></PnPFrameworkPath>
1516
<PnPCoreSdkPath Condition="'$(PnPCoreSdkPath)' == ''"></PnPCoreSdkPath>
@@ -19,6 +20,12 @@
1920
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
2021
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
2122
<EnableNETAnalyzers>true</EnableNETAnalyzers>
23+
<RepositoryUrl>https://github.com/pnp/powershell</RepositoryUrl>
24+
<PackageProjectUrl>https://github.com/pnp/powershell</PackageProjectUrl>
25+
<PackageTags>Microsoft 365; PowerShell; SharePoint; Teams; Graph; Azure AD</PackageTags>
26+
<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>
27+
<PackageIcon>nugeticon.png</PackageIcon>
28+
<PackageReadmeFile>README.md</PackageReadmeFile>
2229
</PropertyGroup>
2330

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

4451
<ItemGroup>
4552
<PackageReference Include="AngleSharp" Version="0.14.0" />
46-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />
53+
4754
<PackageReference Include="Microsoft.Graph" Version="3.33.0" />
4855
<PackageReference Include="Microsoft.Identity.Client" Version="4.36.1" />
4956
<PackageReference Include="Microsoft.SharePointOnline.CSOM" Version="16.1.*" />
50-
<PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" />
51-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
52-
57+
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.12.2" />
5358
<PackageReference Include="PnP.Framework" Version="1.11.*-*" Condition="'$(PnPFrameworkPath)' == '' and '$(IsRelease)' != '1'" />
5459
<PackageReference Include="PnP.Framework" Version="1.11.*-*" Condition="'$(IsRelease)' == '1'" />
5560

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

7076
<!-- <PackageReference Include="PnP.Core.Transformation.SharePoint" Version="1.6.*-*" Condition="'$(PnPCoreSdkPath)' == '' and '$(IsRelease)' != '1'" />
7177
<PackageReference Include="PnP.Core.Transformation.SharePoint" Version="*" Condition="'$(IsRelease)' == '1'" /> -->
72-
<PackageReference Include="PnP.Core.Transformation.SharePoint" Version="1.8.*-*" />
73-
78+
<PackageReference Include="PnP.Core.Transformation.SharePoint" Version="1.8.*-*" />
79+
7480
<PackageReference Include="PowerShellStandard.Library" Version="5.1.0" />
75-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
76-
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.12.2" />
7781
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
7882
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
79-
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="4.7.0" />
80-
<PackageReference Include="System.Security.Cryptography.OpenSsl" Version="4.7.0" />
81-
<PackageReference Include="System.Text.Encodings.Web" Version="4.7.2" />
82-
<PackageReference Include="System.Text.Json" Version="4.7.2" />
83-
<PackageReference Include="TextCopy" Version="4.3.1" />
8483
<ProjectReference Include="..\ALC\PnP.PowerShell.ALC.csproj" />
8584

8685
</ItemGroup>
@@ -93,53 +92,113 @@
9392

9493
<ItemGroup Condition="'$(PnPCoreSdkPath)' != '' and '$(IsRelease)' != '1'">
9594
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.1.1" />
96-
<Reference Include="PnP.Core">
95+
<Reference Include="PnP.Core" Condition="'$(TargetFramework)' == 'net6.0-windows'">
96+
<HintPath>$(PnPCoreSdkPath)PnP.Core\bin\Debug\net6.0\PnP.Core.dll</HintPath>
97+
<Private>true</Private>
98+
<SpecificVersion>false</SpecificVersion>
99+
</Reference>
100+
<Reference Include="PnP.Core" Condition="'$(TargetFramework)' == 'net462'">
97101
<HintPath>$(PnPCoreSdkPath)PnP.Core\bin\Debug\netstandard2.0\PnP.Core.dll</HintPath>
98102
<Private>true</Private>
99103
<SpecificVersion>false</SpecificVersion>
100104
</Reference>
101-
<Reference Include="PnP.Core.Auth">
105+
<Reference Include="PnP.Core.Auth" Condition="'$(TargetFramework)' == 'net6.0-windows'">
106+
<HintPath>$(PnPCoreSdkPath)PnP.Core.Auth\bin\Debug\net6.0\PnP.Core.Auth.dll</HintPath>
107+
<Private>true</Private>
108+
<SpecificVersion>false</SpecificVersion>
109+
</Reference>
110+
<Reference Include="PnP.Core.Auth" Condition="'$(TargetFramework)' == 'net462'">
102111
<HintPath>$(PnPCoreSdkPath)PnP.Core.Auth\bin\Debug\netstandard2.0\PnP.Core.Auth.dll</HintPath>
103112
<Private>true</Private>
104113
<SpecificVersion>false</SpecificVersion>
105114
</Reference>
106-
<Reference Include="PnP.Core.Admin">
115+
<Reference Include="PnP.Core.Admin" Condition="'$(TargetFramework)' == 'net6.0-windows'">
116+
<HintPath>$(PnPCoreSdkPath)PnP.Core.Admin\bin\Debug\net6.0\PnP.Core.Admin.dll</HintPath>
117+
<Private>true</Private>
118+
<SpecificVersion>false</SpecificVersion>
119+
</Reference>
120+
<Reference Include="PnP.Core.Admin" Condition="'$(TargetFramework)' == 'net462'">
107121
<HintPath>$(PnPCoreSdkPath)PnP.Core.Admin\bin\Debug\netstandard2.0\PnP.Core.Admin.dll</HintPath>
108122
<Private>true</Private>
109123
<SpecificVersion>false</SpecificVersion>
110124
</Reference>
111-
<Reference Include="PnP.Core.Transformation">
125+
<Reference Include="PnP.Core.Transformation" Condition="'$(TargetFramework)' == 'net6.0-windows'">
126+
<HintPath>$(PnPCoreSdkPath)PnP.Core.Transformation\bin\Debug\net6.0\PnP.Core.Transformation.dll</HintPath>
127+
<Private>true</Private>
128+
<SpecificVersion>false</SpecificVersion>
129+
</Reference>
130+
<Reference Include="PnP.Core.Transformation" Condition="'$(TargetFramework)' == 'net462'">
112131
<HintPath>$(PnPCoreSdkPath)PnP.Core.Transformation\bin\Debug\netstandard2.0\PnP.Core.Transformation.dll</HintPath>
113132
<Private>true</Private>
114133
<SpecificVersion>false</SpecificVersion>
115134
</Reference>
116-
<Reference Include="PnP.Core.Transformation.SharePoint">
135+
<Reference Include="PnP.Core.Transformation.SharePoint" Condition="'$(TargetFramework)' == 'net6.0-windows'">
136+
<HintPath>$(PnPCoreSdkPath)PnP.Core.Transformation.SharePoint\bin\Debug\net6.0\PnP.Core.Transformation.SharePoint.dll</HintPath>
137+
<Private>true</Private>
138+
<SpecificVersion>false</SpecificVersion>
139+
</Reference>
140+
<Reference Include="PnP.Core.Transformation.SharePoint" Condition="'$(TargetFramework)' == 'net462'">
117141
<HintPath>$(PnPCoreSdkPath)PnP.Core.Transformation.SharePoint\bin\Debug\netstandard2.0\PnP.Core.Transformation.SharePoint.dll</HintPath>
118142
<Private>true</Private>
119143
<SpecificVersion>false</SpecificVersion>
120144
</Reference>
121145
</ItemGroup>
122146

123147
<ItemGroup Condition="'$(PnPFrameworkPath)' != '' and '$(IsRelease)' != '1'">
124-
<Reference Include="PnP.Framework">
148+
<Reference Include="PnP.Framework" Condition="'$(TargetFramework)' == 'net6.0-windows'">
149+
<HintPath>$(PnPFrameworkPath)PnP.Framework\bin\Debug\net6.0\PnP.Framework.dll</HintPath>
150+
<Private>true</Private>
151+
<SpecificVersion>false</SpecificVersion>
152+
</Reference>
153+
<Reference Include="PnP.Framework" Condition="'$(TargetFramework)' == 'net462'">
125154
<HintPath>$(PnPFrameworkPath)PnP.Framework\bin\Debug\netstandard2.0\PnP.Framework.dll</HintPath>
126155
<Private>true</Private>
127156
<SpecificVersion>false</SpecificVersion>
128157
</Reference>
129158
</ItemGroup>
130159

131-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
132-
<PackageReference Include="System.Management.Automation" Version="7.0.3" />
160+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows'">
161+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
162+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
163+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.0" />
164+
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
165+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
166+
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="6.0.0" />
167+
<PackageReference Include="System.Security.Cryptography.OpenSsl" Version="5.0.0" />
168+
<PackageReference Include="System.Text.Encodings.Web" Version="6.0.0" />
169+
<PackageReference Include="System.Management.Automation" Version="7.2.0" />
170+
<PackageReference Include="System.Text.Json" Version="6.0.7" />
171+
<PackageReference Include="TextCopy" Version="6.1.0" />
172+
133173
</ItemGroup>
134174

135175
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
136-
<PackageReference Include="Microsoft.PowerShell.5.ReferenceAssemblies" Version="1.1.0" />
176+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />
177+
<PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" />
178+
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
179+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
180+
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="4.7.0" />
181+
<PackageReference Include="System.Security.Cryptography.OpenSsl" Version="4.7.0" />
182+
<PackageReference Include="System.Text.Encodings.Web" Version="4.7.2" />
183+
<PackageReference Include="System.Text.Json" Version="4.7.2" />
184+
<PackageReference Include="TextCopy" Version="4.3.1" />
137185
</ItemGroup>
138186

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

191+
<ItemGroup>
192+
<None Include="..\..\nugeticon.png">
193+
<Pack>True</Pack>
194+
<PackagePath>\</PackagePath>
195+
</None>
196+
<None Include="..\..\README.md">
197+
<Pack>True</Pack>
198+
<PackagePath>\</PackagePath>
199+
</None>
200+
</ItemGroup>
201+
143202
<ItemGroup>
144203
<EmbeddedResource Update="Properties\Resources.resx">
145204
<Generator>ResXFileCodeGenerator</Generator>

src/Commands/Sdk.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<Sdk Name="Microsoft.NET.Sdk" />
33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
4+
<TargetFrameworks>net6.0-windows</TargetFrameworks>
55
</PropertyGroup>
66
</Project>

src/Commands/WindowsSdk.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<Sdk Name="Microsoft.NET.Sdk.WindowsDesktop" />
33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
4+
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
55
<UseWindowsForms>true</UseWindowsForms>
66
</PropertyGroup>
77
</Project>

src/Commands/_debug/debug.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ $BinPath = "$ProjectPath\bin\Debug"
33

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

6-
$netversion = "netcoreapp3.1"
6+
$netversion = "net6.0-windows"
77

8-
if ($PSEdition -eq 'Core') {
9-
$netversion = "netcoreapp3.1"
8+
if ($PSEdition -eq 'Core') {
9+
$netversion = "net6.0-windows"
1010
}
1111
else {
1212
$netversion = "net462"

src/Tests/PnP.PowerShell.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net6.0-windows</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<AssemblyName>PnP.PowerShell.Tests</AssemblyName>
77
<RootNamespace>PnP.PowerShell.Tests</RootNamespace>

0 commit comments

Comments
 (0)