$args contains the passing arguements, but no script name. How to get the
script name inside itself in Powershell?
Thanks!
$args contains the passing arguements, but no script name. How to get the
script name inside itself in Powershell?
Thanks!
Inside the script, try:
$MyInvocation.InvocationName
"Ben" <Ben@newsgroup> wrote in message
news:2DF1594D-CDF6-4A43-A2A5-B52B116CA6BA@newsgroup
>
> $args contains the passing arguements, but no script name. How to get the
> script name inside itself in Powershell?
>
> Thanks!
Hi Ben,
have a look at $MyInvocation variable (ScriptName).
Martin
"Ben" <Ben@newsgroup> wrote in message
news:2DF1594D-CDF6-4A43-A2A5-B52B116CA6BA@newsgroup
>
> $args contains the passing arguements, but no script name. How to get the
> script name inside itself in Powershell?
>
> Thanks!
| Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script to read information inside a pdf file | Alex St-Pierre | VB Script | 1 | 07 Oct 2009 |
| Can PowerShell retrieve AD "Member Of' information? | briangw | PowerShell | 0 | 06 May 2009 |
| How can I resolve %WINDIR% inside a PowerShell script? | ssg31415926 | PowerShell | 3 | 04 Sep 2008 |
| Script to retrieve file versions | tke402 | VB Script | 1 | 30 Jul 2008 |
| a powershell window inside visual studio? | tbh | PowerShell | 2 | 03 Jul 2008 |