-
Notifications
You must be signed in to change notification settings - Fork 395
Upgrade 'System.Automation.Management' NuGet package of version 6.0.0-alpha13 to official version 6.0.2 from powershell-core feed, which requires upgrade to netstandard2.0 #919
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
…h required upgrade from netstandard 1.6 to netstandard2.0,which included some breaking changes in netstandard2.0 that required some more nuget packges.
@@ -1141,7 +1141,7 @@ private List<ExternalRule> GetExternalRule(string[] moduleNames) | |||
{ | |||
dynamic description = helpContent[0].Properties["Description"]; | |||
|
|||
if (null != description && null != description.Value && description.Value.GetType().IsArray) | |||
if (description != null && description.Value != null && description.Value.GetType().IsArray) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just to highlight why I needed the NuGet package for Microsoft.CSharp
, which was included in netstandard1.6
but not netstandard2.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup - I found this as well when I was looking at building against PowerShellStandard.Library
Rules/Rules.csproj
Outdated
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'"> | ||
<PackageReference Include="System.Management.Automation" Version="6.0.1.1" /> | ||
<PackageReference Include="Microsoft.Management.Infrastructure" Version="1.0.0-alpha08" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good example to show that the old System.Management.Automation
package was self-contained and now we also need its other dependency Microsoft.Management.Infrastructure
.
I wonder - Could PSSA use current PowerShell installation? - there is SMA.dll with all dependencies. |
@iSazonov Can you please clarify what you mean by |
My quesion is could PSSA load needed dlls from |
It probably could but we don't wan't to. The whole point of this PR is being able to consume the latest version of system.management.automation with the latest required features of the parser. |
…nalyzer into Parser # Conflicts: # Rules/Rules.csproj # appveyor.yml
The reason for the PowerShell Core Appveyor failure is because the Windows image is still using pwsh 6.0.0 but the system.management,automation reference is 6.0.1. I opened an issue at appveyor/ci#2230 and this will get fixed in the next 3 weeks, therefore it is probably best to disable the PowerShell Core build on Windows for the moment (the Ubuntu build should give us enough coverage in the meantime). Just using the 6.0.0 package instead is not a good either because the 6.0.0 package only works for netcore2.0 but only the 6.0.2 packages were fixed to work with netstandard2.0 |
…d by the new system.management.automation package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one real question down below. Otherwise, this looks fine.
@@ -1141,7 +1141,7 @@ private List<ExternalRule> GetExternalRule(string[] moduleNames) | |||
{ | |||
dynamic description = helpContent[0].Properties["Description"]; | |||
|
|||
if (null != description && null != description.Value && description.Value.GetType().IsArray) | |||
if (description != null && description.Value != null && description.Value.GetType().IsArray) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup - I found this as well when I was looking at building against PowerShellStandard.Library
Rules/Rules.csproj
Outdated
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'"> | ||
<PackageReference Include="System.Management.Automation" Version="6.0.2" /> | ||
<PackageReference Include="Microsoft.Management.Infrastructure" Version="1.0.0-alpha08" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this just be Version="1.0.0-alpha*
(that's what it is in PowerShell repo)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it is reasonable to always take the latest version of a pre-release package.
Engine/Engine.csproj
Outdated
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'net451'"> | ||
<PackageReference Include="System.Management.Automation" Version="6.0.0-alpha13" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is really about full CLR should we still point at this? Would Microsoft.PowerShell.5.ReferenceAssemblies be better? (or Microsoft.PowerShell.3.ReferenceAssemblies) rather than pointing off to that alpha13 thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment this PR changes it only for the coreclr but I can look into how to do it for full CLR. I first wanted to rather start with the simpler task but maybe it is better to do both in one go.
… (i.e. latest instead of specific)
I think we're ready to go - go ahead and merge |
PR Summary
Closes #879
At the moment we use an unofficial package from Nuget.org, which is a self-contained version of
System.Management.Automation
(including dependencies) from6.0.0-alpha13
, which contains the Parser that PSSA uses.For coreclr:
netstandard1.6
tonetstandard2.0
, which required some more NuGet packages:Microsoft.CSharp
,Microsoft.Management.Infrastructure
(for DSC rules, this is only available as a pre-release) andSystem.Reflection.TypeExtensions
For fullclr:
UseIdenticalMandatoryParametersDSC
compiles only in PSv4 I had to add a newPSV4Release
build option.Old unused csproj files were also removed
The reason for the PowerShell Core Appveyor failure is because the Windows image is still using pwsh 6.0.0 but the system.management,automation reference is 6.0.2. I opened an issue at appveyor/ci#2230 and this will get fixed in the next 3 weeks, therefore a step was added to install pwsh 6.0.2 on the Windows image if necessary
PR Checklist
Note: Tick the boxes below that apply to this pull request by putting an
x
between the square brackets. Please mark anything not applicable to this PRNA
.WIP:
to the beginning of the title and remove the prefix when the PR is ready