Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

winrm in powershell vs. in cmd.exe

Closed Thread
 
Thread Tools Display Modes
Old 05-08-2008   #1 (permalink)
Simon
Guest


 

winrm in powershell vs. in cmd.exe

Hi,

I have a winrm command that works perfectly when I run it in cmd.exe,
but when I try to run the same command in Powershell (V2 CTP2) I get
the following error: Error: Invalid use of command line. Type "winrm
-?" for help.

It seems that whenever I try to use the @{key="value"} pairs as
parameters I get this error. Has anybody else seen this issue, and
possibly know a way around it?

Thanks,

Simon
Old 05-08-2008   #2 (permalink)
Marco Shaw [MVP]
Guest


 

Re: winrm in powershell vs. in cmd.exe

Simon wrote:
Quote:

> Hi,
>
> I have a winrm command that works perfectly when I run it in cmd.exe,
> but when I try to run the same command in Powershell (V2 CTP2) I get
> the following error: Error: Invalid use of command line. Type "winrm
> -?" for help.
>
> It seems that whenever I try to use the @{key="value"} pairs as
> parameters I get this error. Has anybody else seen this issue, and
> possibly know a way around it?
>
> Thanks,
>
> Simon
Example of escaping characters to make something work:

PSH> winrm set winrm/config/client `@`{TrustedHosts=`"`*`"`}

Everything but the text and the equal sign in this case...

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
Old 05-08-2008   #3 (permalink)
Simon
Guest


 

Re: winrm in powershell vs. in cmd.exe

That was exactly what I needed. Thanks.

Simon
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
WinRM DS_user DS_userparameters kburgoyne PowerShell 5 05-13-2008 12:03 PM
help translating winrm authendication to powershell mandankid PowerShell 2 04-16-2008 12:49 PM
Help configuring WinRM ssg31415926 PowerShell 20 03-06-2008 09:03 AM
WinRM Pablo Vista installation & setup 0 12-03-2007 03:31 PM
WinRM from PowerShell Chris Warwick PowerShell 2 11-06-2007 02:19 PM








Vistax64.com 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 2005-2008

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 47 48 49 50