![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Current script special variable Hi, Is there a special variable that contains the current running script like Perl and Bash: $0 If so, can you tell me where this is documented? Thanks in advance, Frank |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Current script special variable Frank wrote: > Hi, > > Is there a special variable that contains the current running script like > Perl and Bash: $0 The $MyInvocation variable should have the information that you want. PS> echo "`$MyInvocation" > myinv.ps1 PS> .\myinv.ps1 MyCommand : myinv.ps1 ScriptLineNumber : 1 OffsetInLine : -2147483648 ScriptName : Line : .\myinv.ps1 PositionMessage : At line:1 char:11 + .\myinv.ps1 <<<< InvocationName : .\myinv.ps1 PipelineLength : 1 PipelinePosition : 1 > If so, can you tell me where this is documented? > > Thanks in advance, > > Frank > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| return variable through script in script | VB Script | |||
| Script to hide a variable folder | VB Script | |||
| Set a variable for the current domain | PowerShell | |||
| Suggestion: New special variable for pipeline enumeration index | PowerShell | |||
| Manipulating current directory as a variable | PowerShell | |||