Shahar Gvirtz's Weblog

How to get the full command line

Someone asked me, and I post here the answer - sometimes, we want to get from our command-let the command that the user entered to use our command-let. we want the full line, with all the command-lets in the pipeline and all the parameters.

In this case, we will use the following code (works only from command-lets that derived from System.Management.Automation.PSCmdlet):

string commandLine = this.MyInvocation.Line;

Shahar.

Comments

Deianira said:

Sorry. Nice website. I can see why its so popular. Help me! Need information about: Elasticized table pad. I found only this - <a href="www.ist-shareit.eu/.../custom-dining-room-table-pads">custom dining room table pads</a>. Home had provided a release of pads from the person, table pads. Table pads, find incisive women as pecuniary. THX :rolleyes:, Deianira from Guatemala.

# March 23, 2010 1:06 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)