Skip to content

New Command

Apostolis Bekiaris edited this page Apr 22, 2020 · 9 revisions

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

New-Command

SYNOPSIS

Uses an external processs 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
4.0.0.0        dfsvc
10.0.0.0       EventViewer
10.0.0.0       EventViewer.Resources
3.5.1.0        Google.Protobuf
10.0.0.0       InspectVhdDialog
10.0.0.0       InspectVhdDialog.Resources
10.0.0.0       InspectVhdDialog6.2
10.0.0.0       InspectVhdDialog6.2.Resources
10.0.0.0       InspectVhdDialog6.3
10.0.0.0       InspectVhdDialog6.3.Resources
4.0.0.0        Microsoft.Activities.Build

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