Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista Tutorial - Re: how to see arguments with powershell when running winrs

Reply
 
Old 06-25-2008   #1 (permalink)
Shay Levi
Guest


 
 

Re: how to see arguments with powershell when running winrs



PS > (gwmi win32_process -filter "name='powershell.exe'").commandLine


When there is more than one powershell instance running:

PS > gwmi win32_process -filter "name='powershell.exe'" | select name,commandLine


---
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com

F> Hi,
F>
F> When running a Powershell script via winrs, is it possible to see
F> what arguments are used so that I can see which Powershell script it
F> is running?
F>
F> ie:
F>
F> winrs /r:testhost powershell.exe -nologo -noprofile c:\test.ps1
F>
F> when I do get-process on the target host, I get just "powershell" for
F> processname. I would like to see "c:\test.ps1"
F>
F> ie,
F>
F> [C:\]: get-process |?{$_.name -eq "Powershell"}
F>
F> Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
F> ------- ------ ----- ----- ----- ------ -- -----------
F> 516 21 79204 91616 600 14.29 932 powershell
F> Thanks in advance,
F>



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Passing arguments from .BAT to PowerShell script PowerShell
Re: how to run powershell via winrs PowerShell
Re: problems with esentutl.exe running in powershell with winrs FAILUR PowerShell
powershell arguments : PARAM vs ARGS ? PowerShell
Difference in how PowerShell treats arguments vs CMD PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46