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 - get-command parameters

Reply
 
Old 08-01-2008   #1 (permalink)
Marcelo Moraes


 
 

get-command parameters

Hi

get-service without -computername runs in the local host. How can I run the
same command for getting services from a remote computer?
I don't want to use wmi... cmdlet. Is that possible?

e.g: PS> get-service -computername <computername>

My System SpecsSystem Spec
Old 08-01-2008   #2 (permalink)
Justin Rich


 
 

Re: get-command parameters

err might be broken...

from help
SYNTAX
Get-Service [[-name] <string[]>] [-include <string[]>] [-exclude
<string[]>] [-computerName <string[]>] [<CommonPar
ameters>]
-computerName <string[]>
Gets the services on the specified computers. The default is the local
computer. Type the NETBIOS name, an IP a
ddress, or a fully-qualified domain name of one or more computers.


but, if i do that, i get an error telling me that its not a valid argument

i havent updated my 2.0 build in a while

PS D:\PS\test> (get-host).version

Major Minor Build Revision
----- ----- ----- --------
2 0 -1 -1



"Marcelo Moraes" <MarceloMoraes@xxxxxx> wrote in message
news:72B00386-75F0-4325-A603-AB70ECAD0EBD@xxxxxx
Quote:

> Hi
>
> get-service without -computername runs in the local host. How can I run
> the
> same command for getting services from a remote computer?
> I don't want to use wmi... cmdlet. Is that possible?
>
> e.g: PS> get-service -computername <computername>

My System SpecsSystem Spec
Old 08-01-2008   #3 (permalink)
Alex K. Angelopoulos


 
 

Re: get-command parameters

It works in CTP2v2, and shows up in the get-command -syntax listing - which
is always going to be correct, even if the help file includes dream content.


"Justin Rich" <jrich523@xxxxxx> wrote in message
news:eSgbs#A9IHA.356@xxxxxx
Quote:

> err might be broken...
>
> from help
> SYNTAX
> Get-Service [[-name] <string[]>] [-include <string[]>] [-exclude
> <string[]>] [-computerName <string[]>] [<CommonPar
> ameters>]
> -computerName <string[]>
> Gets the services on the specified computers. The default is the local
> computer. Type the NETBIOS name, an IP a
> ddress, or a fully-qualified domain name of one or more computers.
>
>
> but, if i do that, i get an error telling me that its not a valid argument
>
> i havent updated my 2.0 build in a while
>
> PS D:\PS\test> (get-host).version
>
> Major Minor Build Revision
> ----- ----- ----- --------
> 2 0 -1 -1
>
>
>
> "Marcelo Moraes" <MarceloMoraes@xxxxxx> wrote in
> message news:72B00386-75F0-4325-A603-AB70ECAD0EBD@xxxxxx
Quote:

>> Hi
>>
>> get-service without -computername runs in the local host. How can I run
>> the
>> same command for getting services from a remote computer?
>> I don't want to use wmi... cmdlet. Is that possible?
>>
>> e.g: PS> get-service -computername <computername>
>
>
My System SpecsSystem Spec
Old 08-01-2008   #4 (permalink)
Alex K. Angelopoulos


 
 

Re: get-command parameters

If you're not using PowerShell v2 CTP 2, you can't do that unfortunately. In
the first release, due to the lack of direct remoting, this is generally a
limitation of PowerShell cmdlets. The reason is that unlike WMI classes, the
core .NET objects used were existing 'native' .NET objects. Those objects
were generally designed to meet the needs of application developers, which
means that a lot of things simply weren't easy to use - and many of the
properties that _were_ handy were actually extensions by PowerShell using
WMI under the covers.

"Marcelo Moraes" <MarceloMoraes@xxxxxx> wrote in message
news:72B00386-75F0-4325-A603-AB70ECAD0EBD@xxxxxx
Quote:

> Hi
>
> get-service without -computername runs in the local host. How can I run
> the
> same command for getting services from a remote computer?
> I don't want to use wmi... cmdlet. Is that possible?
>
> e.g: PS> get-service -computername <computername>
My System SpecsSystem Spec
Old 08-04-2008   #5 (permalink)
Marcelo Moraes


 
 

Re: get-command parameters

"Alex K. Angelopoulos" <aka(at)mvps.org> wrote in
news:OtiALvC9IHA.4108@xxxxxx:
Quote:

> If you're not using PowerShell v2 CTP 2, you can't do that
> unfortunately. In the first release, due to the lack of direct
> remoting, this is generally a limitation of PowerShell cmdlets. The
> reason is that unlike WMI classes, the core .NET objects used were
> existing 'native' .NET objects. Those objects were generally designed
> to meet the needs of application developers, which means that a lot of
> things simply weren't easy to use - and many of the properties that
> _were_ handy were actually extensions by PowerShell using WMI under
> the covers.

Hi

Thanks

I have the last version and I couldn't get the service from a remote
computer using this command. I'll research and test more. If I find the
solution I'll post here.

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
echo out interactive parameters that were entered for a command PowerShell
photoscreensaver.scr command line parameters Vista General
Windows Mail: Are there command line parameters? Vista mail
Passing array to .Net command: discrete parameters PowerShell
Invoke-Item and passing command line parameters 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