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
TestPathCommand and several others removed in PowerShell 7.2 SDK #16862
Comments
|
Related - #16141 |
|
Further, if you try to include Microsoft.PowerShell.Commands.Management from NuGet you get the error: Assembly 'Microsoft.PowerShell.Commands.Management' with identity 'Microsoft.PowerShell.Commands.Management, Version=7.3.0.2, Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'System.Management.Automation, Version=7.3.0.2, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Management.Automation' with identity 'System.Management.Automation, Version=7.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' |
|
@SeeminglyScience @adityamandaleeka @TravisEz13 There are 2 problems:
Personally, I don't really care about 2 because I only needed it due to the missing reference in Microsoft.PowerShell.SDK Problem 1I believe to fix it we need to the missing assemblies to the $supportedRefList array to this block of code: PowerShell/tools/packaging/packaging.psm1 Lines 2265 to 2267 in 07175ae
and also to PowerShell/tools/packaging/packaging.psm1 Lines 2456 to 2460 in 07175ae
Problem 2If you are interested in also fixing the mismatch in problem 2, if you add a hintpath you can get Visual Studio to tell you more information about the issue: Before <ItemGroup>
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.1.5" />
<PackageReference Include="Microsoft.PowerShell.Commands.Management" Version="7.1.5"/>
</ItemGroup>After <ItemGroup>
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.1.5" />
<PackageReference Include="Microsoft.PowerShell.Commands.Management" Version="7.1.5">
<GeneratePathProperty>True</GeneratePathProperty>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.PowerShell.Commands.Management">
<HintPath>$(PkgMicrosoft_powershell_commands_management)\runtimes\unix\lib\net6.0\Microsoft.PowerShell.Commands.Management.dll</HintPath>
</Reference>
</ItemGroup> |
|
@dkattan Could you please provide the full csproj? I would like to see the target framework. If targeting NET6 -> use Microsoft.Powershell.SDK v 7.2.7 v7.1.x is out of support and should not be used. Also, v7.0.x is out of support. |
TestPowerShell73Dependency2.zip csproj <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.3.0" />
</ItemGroup>
</Project>Program.cs // See https://aka.ms/new-console-template for more information
using System.Management.Automation.Runspaces;
Console.WriteLine("Hello, World!");
var iss = InitialSessionState.CreateDefault2();
iss.Commands.Add(new SessionStateCmdletEntry("Resolve-Path", typeof(Microsoft.PowerShell.Commands.ResolvePathCommand), null)); |
|
@SeeminglyScience I saw some work done in #18782 v7.4.0-preview.1 related to nuget packages, any chance we can get some traction on this? I just updated my test project to Microsoft.PowerShell.SDK v7.4.0-preview.1 and the problem persists. |
|
Hey @adityapatwardhan Any update on this? |
|
@adityapatwardhan we are having this issue too. Any update? |
|
This issue is not fixed yet. I am working on it and hopefully will be done soon. Thank you for your patience. |
|
@adityapatwardhan We are also seeing this issue. Any luck with a timeline on this? |
|
Still an issue on 7.3.2, SDK is unusable |
|
@adityapatwardhan Can you look at my merge request and perhaps test it since you have access to the required DevOps environment? #19033 |
|
This PR should fix the problem: #19302 We plan to release the next PowerShell Preview with this change. |
Yaaass. While you’re in there, any love for SourceLink or Debug symbols? |
|
Not right now at least. But maybe in a separate PR. |
Like perhaps this one you created 5 years ago? |
|
@dkattan The Microsoft.PowerShell.SDK version v7.4.0-preview.2 will be available on NuGet.org in sometime. Could you please help validate that your scenario is fixed by that? |
I'm trying but I'm not yet seeing it in nuget. |
I found it, I didn't have the Include Prerelease box checked. Evidently it requires .NET 8 which requires Visual Studio 2022 17.6 Preview. Got all that installed. When I attempt to install Microsoft.PowerShell.SDK or Microsoft.PowerShell.Commands.Utility I get: System.Management.Automation, Microsoft.PowerShell.Commands.Diagnostics and Microsoft.PowerShell.Commands.Management install fine. Installing Microsoft.PowerShell.Commands.Management 7.4.0-preview.2 does solve the problem for TestPathCommand. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.






Prerequisites
Steps to reproduce
Using C# SDK, I updated
Microsoft.PowerShell.Commands.Managementfrom7.1.5to7.2.1.The SDK no longer has references to the following commands:
If this was intentional, how should I be referencing these commands?
Expected behavior
I need to import the commands listed under steps to reproduceActual behavior
I can now longer use the commands listed under steps to reproduceError details
No response
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: