Imports PipeScript
Imports PipeScript in a dynamic module.
EXAMPLE 1
Import-PipeScript -ScriptBlock {
function gh {
[Inherit('gh',CommandType='Application')]
param()
}
}EXAMPLE 2
Import-PipeScript -ScriptBlock {
partial function f {
"This will be added to any function named f."
}
}The Command to run or ScriptBlock to import.
| Type | Required | Position | PipelineInput | Aliases |
|---|---|---|---|---|
[Object] |
true | 1 | true (ByValue, ByPropertyName) | ScriptBlock CommandName CommandInfo |
Indicates that this returns a custom object with members that represent the imported module members
When you use the AsCustomObject parameter, Import-PipeScript imports the module members into the session and then returns a
PSCustomObject object instead of a PSModuleInfo object. You can save the custom object in a variable and use dot notation
to invoke the members.
| Type | Required | Position | PipelineInput |
|---|---|---|---|
[Switch] |
false | named | false |
Returns an object representing the item with which you're working. By default, this cmdlet does not generate any output.
| Type | Required | Position | PipelineInput |
|---|---|---|---|
[Switch] |
false | named | false |
Specifies a name for the imported module. The default value is an autogenerate name containing the time it was generated.
| Type | Required | Position | PipelineInput |
|---|---|---|---|
[String] |
false | 2 | false |
If set, will not transpile a -Command that is a [ScriptBlock] All other types of -Command will be transpiled, disregarding this parameter.
| Type | Required | Position | PipelineInput |
|---|---|---|---|
[Switch] |
false | named | false |
Import-PipeScript [-Command] <Object> [-AsCustomObject] [-PassThru] [[-Name] <String>] [-NoTranspile] [<CommonParameters>]