Skip to content

New Command

apobekiaris edited this page Sep 4, 2020 · 9 revisions

external help file: XpandPwsh-help.xml Module Name: XpandPwsh online version: schema: 2.0.0

New-Command

SYNOPSIS

Uses an external process to execute a command and captures the output.

SYNTAX

New-Command [[-commandTitle] <Object>] [[-commandPath] <Object>] [[-commandArguments] <Object>]
 [[-workingDir] <Object>] [<CommonParameters>]

DESCRIPTION

This Cmdlet can be used to execute Windows powershell CmdLets from PowerShell Core.

EXAMPLES

Example 1

PS C:\> (New-Command "Gac Assemblies" -commandPath "c:\windows\syswow64\WindowsPowerShell\v1.0\powershell.exe" -commandArguments "-command `"& {&'Get-GacAssembly' }`"").stdout

19.2.0.0       DevExpress.XtraVerticalGrid.v19.2.resources
19.2.6.0       DevExpress.XtraWizard.v19.2
19.2.6.0       DevExpress.XtraWizard.v19.2.Design
19.2.0.0       DevExpress.XtraWizard.v19.2.resources
19.2.0.0       DevExpress.XtraWizard.v19.2.resources
19.2.0.0       DevExpress.XtraWizard.v19.2.resources
19.2.0.0       DevExpress.XtraWizard.v19.2.resources

Executes the Get-GacAssembly .NET Framework command from a powershell core prompt.

PARAMETERS

-commandArguments

{{ Fill commandArguments Description }}

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-commandPath

{{ Fill commandPath Description }}

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-commandTitle

{{ Fill commandTitle Description }}

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-workingDir

{{ Fill workingDir Description }}

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

None

OUTPUTS

System.Object

NOTES

RELATED LINKS

image

image


Star the project if you think it deserves it.

GitHub stars

Fork the project to extend and contribute.

GitHub forks

Clone this wiki locally