Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: bump to .NET 6 #2292

Merged
merged 27 commits into from
Dec 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6bd2159
Bump to .net 6
gautamdsheth Aug 30, 2022
8f940a9
Merge branch 'dev' into feature/net6update
gautamdsheth Aug 30, 2022
b53f69a
Bumps to dependencies for .net 6
gautamdsheth Aug 31, 2022
940faf0
Added additional metadata
gautamdsheth Aug 31, 2022
e2498ec
Merge branch 'dev' into feature/net6update
gautamdsheth Sep 5, 2022
8ca2732
Updated to .NET6 build
KoenZomers Sep 5, 2022
4f7510b
Merge branch 'dev' into feature/net6update
gautamdsheth Sep 11, 2022
791ad56
Added backward compatibility for older runtime
gautamdsheth Sep 11, 2022
ffc13a1
Merge branch 'dev' into feature/net6update
gautamdsheth Sep 16, 2022
11e9d6e
Bump deps
gautamdsheth Sep 16, 2022
734f75e
Fix deps
gautamdsheth Sep 16, 2022
8764fb2
Fix PnP framework path
gautamdsheth Sep 16, 2022
1d17bd7
Merge branch 'dev' into feature/net6update
gautamdsheth Sep 30, 2022
f1cf6a7
Merge branch 'dev' into feature/net6update
gautamdsheth Oct 8, 2022
4260c8a
Merge branch 'dev' into feature/net6update
gautamdsheth Oct 15, 2022
1fb9c84
Merge branch 'dev' into feature/net6update
gautamdsheth Oct 27, 2022
010901e
Merge branch 'dev' into feature/net6update
gautamdsheth Oct 28, 2022
ccdb9f9
Fix docker doc file
gautamdsheth Oct 28, 2022
ea43ee1
Merge branch 'dev' into feature/net6update
KoenZomers Nov 3, 2022
a71548d
Removing reference to Microsoft.Extensions.Logging.Abstractions
KoenZomers Nov 3, 2022
a9e87c2
Merge branch 'dev' into feature/net6update
gautamdsheth Nov 9, 2022
94cb507
Update nightlyrelease.yml
gautamdsheth Nov 9, 2022
006c080
Merge branch 'dev' into feature/net6update
gautamdsheth Nov 11, 2022
93e5695
Merge branch 'dev' into feature/net6update
KoenZomers Dec 1, 2022
60d627c
Merge branch 'dev' into feature/net6update
gautamdsheth Dec 2, 2022
c7795c9
Update README.md
erwinvanhunen Dec 2, 2022
786a4d7
Merge branch 'dev' into feature/net6update
gautamdsheth Dec 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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