Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,6 @@ private int GetCommandTypePriority(CommandTypes commandType)
case CommandTypes.Filter:
case CommandTypes.Function:
case CommandTypes.Script:
case CommandTypes.Workflow:
return 20;

case CommandTypes.Cmdlet:
Expand Down
7 changes: 1 addition & 6 deletions src/System.Management.Automation/engine/CommandInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ public enum CommandTypes
/// </summary>
Script = 0x0040,

/// <summary>
/// A workflow.
/// </summary>
Workflow = 0x0080,

/// <summary>
/// A Configuration.
/// </summary>
Expand All @@ -87,7 +82,7 @@ public enum CommandTypes
/// Note, a CommandInfo instance will never specify
/// All as its CommandType but All can be used when filtering the CommandTypes.
/// </remarks>
All = Alias | Function | Filter | Cmdlet | Script | ExternalScript | Application | Workflow | Configuration,
All = Alias | Function | Filter | Cmdlet | Script | ExternalScript | Application | Configuration,
}

/// <summary>
Expand Down
5 changes: 0 additions & 5 deletions src/System.Management.Automation/engine/EventManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1852,11 +1852,6 @@ private PSEngineEvent() { }
/// </summary>
public const string OnIdle = "PowerShell.OnIdle";

/// <summary>
/// Called when a workflow job is started from a PowerShell script.
/// </summary>
public const string WorkflowJobStartEvent = "PowerShell.WorkflowJobStartEvent";

/// <summary>
/// Called during scriptblock invocation.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4119,7 +4119,7 @@ .FORWARDHELPCATEGORY Cmdlet
[string]
${Path},

[ValidateSet('Alias','Cmdlet','Provider','General','FAQ','Glossary','HelpFile','ScriptCommand','Function','Filter','ExternalScript','All','DefaultHelp','Workflow','DscResource','Class','Configuration')]
[ValidateSet('Alias','Cmdlet','Provider','General','FAQ','Glossary','HelpFile','ScriptCommand','Function','Filter','ExternalScript','All','DefaultHelp','DscResource','Class','Configuration')]
[string[]]
${Category},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,9 @@ private PSModuleInfo LoadModuleNamedInManifest(PSModuleInfo parentModule, Module
Modules.ManifestMemberNotValid,
moduleSpecification.Name,
"NestedModules",
parentModule.Path,
parentModule?.Path,
StringUtil.Format(Modules.InvalidModuleExtension, extension, moduleSpecification.Name),
ModuleIntrinsics.GetModuleName(parentModule.Path));
ModuleIntrinsics.GetModuleName(parentModule?.Path));
invalidOperation.SetErrorId("Modules_InvalidModuleExtension");
throw invalidOperation;
}
Expand Down Expand Up @@ -1539,40 +1539,6 @@ internal PSModuleInfo LoadModuleManifest(

string actualRootModule = moduleToProcess ?? rootModule;

// If the root module is a workflow module, the 'actualRootModule' is nulled out.
// We need to save this name so that we can assign this to the RootModule property of ModuleInfo.
string savedActualRootModule = actualRootModule;

if (string.Equals(System.IO.Path.GetExtension(actualRootModule),
StringLiterals.WorkflowFileExtension, StringComparison.OrdinalIgnoreCase))
{
if (WildcardPattern.ContainsWildcardCharacters(actualRootModule))
{
PSInvalidOperationException invalidOperation = PSTraceSource.NewInvalidOperationException(
Modules.WildCardNotAllowedInModuleToProcessAndInNestedModules,
moduleManifestPath);
invalidOperation.SetErrorId("Modules_WildCardNotAllowedInModuleToProcessAndInNestedModules");
throw invalidOperation;
}

if (writingErrors)
{
message = StringUtil.Format(Modules.WorkflowModuleNotSupported, actualRootModule);
WriteError(new ErrorRecord(
new NotSupportedException(message),
"Modules_WorkflowModuleNotSupported",
ErrorCategory.InvalidOperation, null));
}

// Null out 'actualRootModule' so don't attempt to process the file like a non-workflow module later.
actualRootModule = null;
containedErrors = true;
if (bailOnFirstError)
{
return null;
}
}

// extract defaultCommandPrefix from the manifest
string defaultCommandPrefix = null;
if (
Expand Down Expand Up @@ -2013,28 +1979,7 @@ internal PSModuleInfo LoadModuleManifest(
throw invalidOperation;
}

if (string.Equals(System.IO.Path.GetExtension(s.Name),
StringLiterals.WorkflowFileExtension, StringComparison.OrdinalIgnoreCase))
{
if (writingErrors)
{
message = StringUtil.Format(Modules.WorkflowModuleNotSupported, s.Name);
WriteError(new ErrorRecord(
new NotSupportedException(message),
"Modules_WorkflowModuleNotSupported",
ErrorCategory.InvalidOperation, null));
}

containedErrors = true;
if (bailOnFirstError)
{
return null;
}
}
else
{
nestedModules.Add(s);
}
nestedModules.Add(s);
}

Array.Clear(tmpNestedModules, 0, tmpNestedModules.Length);
Expand Down Expand Up @@ -2593,8 +2538,8 @@ internal PSModuleInfo LoadModuleManifest(
}
}

manifestInfo.RootModule = savedActualRootModule;
manifestInfo.RootModuleForManifest = savedActualRootModule;
manifestInfo.RootModule = actualRootModule;
manifestInfo.RootModuleForManifest = actualRootModule;
if (manifestGuid != null)
{
manifestInfo.SetGuid((Guid)manifestGuid);
Expand Down Expand Up @@ -5918,15 +5863,6 @@ internal PSModuleInfo LoadModule(PSModuleInfo parentModule, string fileName, str
}
}
}
else if (ext.Equals(StringLiterals.WorkflowFileExtension, StringComparison.OrdinalIgnoreCase))
{
found = true;
message = StringUtil.Format(Modules.WorkflowModuleNotSupported, fileName);
WriteError(new ErrorRecord(
new NotSupportedException(message),
"Modules_WorkflowModuleNotSupported",
ErrorCategory.InvalidOperation, null));
}
else
{
found = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,6 @@ internal static ExperimentalFeature[] GetExperimentalFeature(string manifestPath
StringLiterals.PowerShellScriptFileExtension,
StringLiterals.PowerShellModuleFileExtension,
StringLiterals.PowerShellCmdletizationFileExtension,
StringLiterals.WorkflowFileExtension,
StringLiterals.PowerShellNgenAssemblyExtension,
StringLiterals.PowerShellILAssemblyExtension,
StringLiterals.PowerShellILExecutableExtension,
Expand All @@ -910,7 +909,6 @@ internal static ExperimentalFeature[] GetExperimentalFeature(string manifestPath
StringLiterals.PowerShellDataFileExtension,
StringLiterals.PowerShellModuleFileExtension,
StringLiterals.PowerShellCmdletizationFileExtension,
StringLiterals.WorkflowFileExtension,
StringLiterals.PowerShellNgenAssemblyExtension,
StringLiterals.PowerShellILAssemblyExtension,
StringLiterals.PowerShellILExecutableExtension,
Expand Down
15 changes: 0 additions & 15 deletions src/System.Management.Automation/engine/Modules/PSModuleInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,17 +1205,6 @@ internal void AddDetectedAliasExport(string name, string value)
DetectedAliasExports[name] = value;
}

/// <summary>
/// Lists the workflows exported by this module.
/// </summary>
public Dictionary<string, FunctionInfo> ExportedWorkflows
{
get
{
return new Dictionary<string, FunctionInfo>(StringComparer.OrdinalIgnoreCase);
}
}

/// <summary>
/// </summary>
public ReadOnlyCollection<string> ExportedDscResources
Expand Down Expand Up @@ -1582,10 +1571,6 @@ public enum ModuleType
/// Indicates that this is cmdlets-over-objects module (a powershell file with a .CDXML extension)
/// </summary>
Cim,
/// <summary>
/// Indicates that this is workflow module (a powershell file with a .XAML extension)
/// </summary>
Workflow,
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ internal static class StringLiterals
/// </summary>
internal const string PowerShellDataFileExtension = ".psd1";

/// <summary>
/// The file extension (including the dot) of an workflow file.
/// </summary>
internal const string WorkflowFileExtension = ".xaml";

/// <summary>
/// The file extension (including the dot) of an workflow dependent assembly.
/// </summary>
Expand Down
Loading