Partager via


Import-CommandConfiguration

Import a PowerShell Crescendo json file.

Syntaxe

Default (Default)

Import-CommandConfiguration
    [-file] <String>
    [<CommonParameters>]

Description

This cmdlet exports an object that can be converted into a function that acts as a proxy for the platform specific command. The resultant object may then be used to call a native command that can participate in the PowerShell pipeline. The ToString method of the output object returns a string that can be used to create a function that calls the native command. Microsoft Windows, Linux, and macOS can run the generated function, if the native command is on all platforms.

Exemples

EXAMPLE 1

Import-CommandConfiguration ifconfig.crescendo.json
Verb                    : Invoke
Noun                    : ifconfig
OriginalName            : ifconfig
OriginalCommandElements :
Aliases                 :
DefaultParameterSetName :
SupportsShouldProcess   : False
SupportsTransactions    : False
NoInvocation            : False
Description             : This is a description of the generated function
Usage                   : .SYNOPSIS
                          Run invoke-ifconfig
Parameters              : {[Parameter()]
                          [string]$Interface = ""}
Examples                :
OriginalText            :
HelpLinks               :
OutputHandlers          :

Paramètres

-file

The JSON file that represents the command to be wrapped.

Parameter properties

Type:String
Valeur par défaut:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Entrées

None

Sorties

A Command object

Notes

The object returned by Import-CommandConfiguration is converted through the ToString method. Generally, you should use the Export-CrescendoModule to create a PowerShell .psm1 file.