using Enums as parameters in a script

Is there a way to use an enumeration from a C# set of code for instance this enumeration So that I can use this enumeration as an input to a script to create a sql job:

Produces the following names:
TransactSql
ActiveScripting
CmdExec
Snapshot
LogReader
Distribution
Merge
QueueReader
AnalysisQuery
AnalysisCommand
Ssis
PowerShell

How can I use this in a param block so the valid values are from the enumeration?

I know with parameter set I can do ValidateSet but I want it to be dynamic.

You can specify the data type for your parameter as the enum type and it will even give intellisense for the type names. I don’t have that assembly on my computer to test but here’s an example using system.consolecolor:

function test {
[cmdletbinding()]
param(
[system.consolecolor]$color
)
}

thank you that worked perfectly. exactly what I was looking for.

function test-function
{
  param([Microsoft.SqlServer.Management.Smo.Agent.agentsubsystem]$name)
    out-host $name
 }