-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Committee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
Summary of the new feature/enhancement
Currently PowerShell has a method that allows this, AddCommand(CommandInfo). However, there's no supported way to add a CommandInfo to a PSCommand instance directly. PowerShellEditorServices (and likely other projects) construct a PSCommand instance well before actually getting to the internal PowerShell object, so working with CommandInfo directly can only be done with reflection.
Proposed technical implementation details (optional)
using System.Management.Automation.Runspaces;
namespace System.Management.Automation
{
public partial sealed class PSCommand
{
public PSCommand AddCommand(CommandInfo commandInfo)
{
return AddCommand(new Command(commandInfo));
}
}
}namespace System.Management.Automation.Runspaces
{
public sealed class Command
{
- internal Command(CommandInfo commandInfo) : this(commandInfo, false)
+ public Command(CommandInfo commandInfo) : this(commandInfo, false)
{
}
}
}vexx32, TylerLeonhardt and rjmholt
Metadata
Metadata
Assignees
Labels
Committee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime