header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

"Cannot find an overload for "XmlNode" and the argument count: "3"."
Last Post 12 Feb 2008 10:43 AM by ahofer. 2 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
ahoferUser is Offline
New Member
New Member
Posts:4

--
07 Feb 2008 08:49 AM  

Hi,

I'm writing a script to move files. Therefore I need some information from a xml file. Everything works fine, except of one thing:

The command:

$a=0; Do{move-item \\servername\dir\$exconfig.Objs.Lokationen.Name[$a] $e
xconfig.Objs.Lokationen.Share[$a]; $a++} While($a -lt $lines.Lines)

gives this error back:

Exception retrieving string: "Cannot find an overload for "XmlNode" and the argument count: "3"."
At line:1 char:10+ $a=0; Do{m <<<< ove-item \\servername\dir\$exconfig.Objs.Lokationen.Name[$a] $exconfig.Objs.Lokationen.Share[$a]; $a++} While($a -lt $lines.Lines)

The strange thing is, that the command:

$a=0; Do{$exconfig.Objs.Lokationen.Name[$a],$exconfig.Objs.Lokationen.Share[$a];$a++} While($a -lt $lines.Lines)

works perfectly.

Of course I've already tried the first command with a while loop, but it doesn't work.

Do you have any suggestions?

Thanks in advance.

Greets ahofer

marco.shawUser is Offline
Co-Community Director
Basic Member
Basic Member
Posts:177

--
07 Feb 2008 01:22 PM  
I can't think of an example just now, but try doing this:

... move-item (join-path \\servername\dir $exconfig.Objs.Lokationen.Name[$a]) ...

ahoferUser is Offline
New Member
New Member
Posts:4

--
12 Feb 2008 10:43 AM  
It works, thanks a lot. If I put the values into variables, it works too.
You are not authorized to post a reply.

Active Forums 4.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer