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 - PowerShell PAINFULLY SLOW across network

Reply
 
Old 02-15-2007   #1 (permalink)
mario


 
 

PowerShell PAINFULLY SLOW across network

Am I doing something wrong? I ran the same command in DOS and PowerShell to
get a simple directory of input XML files, roughly 3500 files, across a VPN
connection. The CMD version took about 2 seconds, the PowerShell took SEVERAL
minutes. I didn't even get to the part where I wanted to sort by a property
and get the last few. I thought powershell froze.

the command was simple:

dir \\someserver\somepath\somesubpath > out.txt



My System SpecsSystem Spec
Old 02-16-2007   #2 (permalink)
Jeffery Hicks


 
 

Re: PowerShell PAINFULLY SLOW across network

On Thu, 15 Feb 2007 16:45:03 -0800, mario wrote:

> Am I doing something wrong? I ran the same command in DOS and PowerShell to
> get a simple directory of input XML files, roughly 3500 files, across a VPN
> connection. The CMD version took about 2 seconds, the PowerShell took SEVERAL
> minutes. I didn't even get to the part where I wanted to sort by a property
> and get the last few. I thought powershell froze.
>
> the command was simple:
>
> dir \\someserver\somepath\somesubpath > out.txt


In PowerShell DIR is an alias for Get-ChildItem. It is not the DIR command
in CMD. I suspect the VPN tunnel had something to do with poor performance
in PowerShell, although I don't know what about the cmdlet or .NET would
make that so.

--
Jeffery Hicks
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
VBScript & Windows PowerShell Training -
www.ScriptingTraining.com/classes.asp
Windows PowerShell? - www.SAPIENPress.com/powershell.asp

blog: http://blog.SAPIEN.com
blog: http://jdhitsolutions.blogspot.com
My System SpecsSystem Spec
Old 02-16-2007   #3 (permalink)
mario


 
 

Re: PowerShell PAINFULLY SLOW across network

That is my point. I understood it was an alias, but is there any other choice
to list a directory in Powershelll? I really want to embrace this but all of
my batch files list directories. And yes, across a VPN tunnel. I'm a
developer. I am not given permission to remote into our servers to execute
local scripts.

"Jeffery Hicks" <"jhicks[at]SAPIEN.com" wrote:

> On Thu, 15 Feb 2007 16:45:03 -0800, mario wrote:
>
> > Am I doing something wrong? I ran the same command in DOS and PowerShell to
> > get a simple directory of input XML files, roughly 3500 files, across a VPN
> > connection. The CMD version took about 2 seconds, the PowerShell took SEVERAL
> > minutes. I didn't even get to the part where I wanted to sort by a property
> > and get the last few. I thought powershell froze.
> >
> > the command was simple:
> >
> > dir \\someserver\somepath\somesubpath > out.txt

>
> In PowerShell DIR is an alias for Get-ChildItem. It is not the DIR command
> in CMD. I suspect the VPN tunnel had something to do with poor performance
> in PowerShell, although I don't know what about the cmdlet or .NET would
> make that so.
>
> --
> Jeffery Hicks
> SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
> VBScript & Windows PowerShell Training -
> www.ScriptingTraining.com/classes.asp
> Windows PowerShell? - www.SAPIENPress.com/powershell.asp
>
> blog: http://blog.SAPIEN.com
> blog: http://jdhitsolutions.blogspot.com
>

My System SpecsSystem Spec
Old 02-16-2007   #4 (permalink)
Jeffery Hicks


 
 

Re: PowerShell PAINFULLY SLOW across network

On Fri, 16 Feb 2007 08:26:13 -0800, mario wrote:

> That is my point. I understood it was an alias, but is there any other choice
> to list a directory in Powershelll? I really want to embrace this but all of
> my batch files list directories. And yes, across a VPN tunnel. I'm a
> developer. I am not given permission to remote into our servers to execute
> local scripts.
>
> "Jeffery Hicks" <"jhicks[at]SAPIEN.com" wrote:
>
>> On Thu, 15 Feb 2007 16:45:03 -0800, mario wrote:
>>
>>> Am I doing something wrong? I ran the same command in DOS and PowerShell to
>>> get a simple directory of input XML files, roughly 3500 files, across a VPN
>>> connection. The CMD version took about 2 seconds, the PowerShell took SEVERAL
>>> minutes. I didn't even get to the part where I wanted to sort by a property
>>> and get the last few. I thought powershell froze.
>>>
>>> the command was simple:
>>>
>>> dir \\someserver\somepath\somesubpath > out.txt

>>
>> In PowerShell DIR is an alias for Get-ChildItem. It is not the DIR command
>> in CMD. I suspect the VPN tunnel had something to do with poor performance
>> in PowerShell, although I don't know what about the cmdlet or .NET would
>> make that so.
>>
>> --
>> Jeffery Hicks
>> SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
>> VBScript & Windows PowerShell Training -
>> www.ScriptingTraining.com/classes.asp
>> Windows PowerShell? - www.SAPIENPress.com/powershell.asp
>>
>> blog: http://blog.SAPIEN.com
>> blog: http://jdhitsolutions.blogspot.com
>>


I suppose you have nothing to lose. So try running the CMD DIR command from
within PowerShell: cmd /c DIR \\server\path
--
Jeffery Hicks
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
VBScript & Windows PowerShell Training -
www.ScriptingTraining.com/classes.asp
Windows PowerShell? - www.SAPIENPress.com/powershell.asp

blog: http://blog.SAPIEN.com
blog: http://jdhitsolutions.blogspot.com
My System SpecsSystem Spec
Old 02-16-2007   #5 (permalink)
Lee Holmes [MSFT]


 
 

Re: PowerShell PAINFULLY SLOW across network

Thanks, Mario.

This is an issue that we are aware of. It is ultimately due to the way that
the .NET Framework handles file and directory operations. CMD.exe uses a set
of features of the Windows API that allow it to collect most file
information in bulk -- such as the file attributes, name, last modified
time, etc. The APIs in the .NET Framework, on the other hand request the
"extended" attribute data, which does not work very well on slow
connections.

We have thought deeply about this, and the solution will ultimately come
from the .NET Framework team.

--
Lee Holmes [MSFT]
Windows PowerShell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.

"Jeffery Hicks" <"jhicks[at]SAPIEN.com"> wrote in message
news:8cyaz7xe5kjz$.11d16xjxr13sm$.dlg@40tude.net...
> On Fri, 16 Feb 2007 08:26:13 -0800, mario wrote:
>
>> That is my point. I understood it was an alias, but is there any other
>> choice
>> to list a directory in Powershelll? I really want to embrace this but all
>> of
>> my batch files list directories. And yes, across a VPN tunnel. I'm a
>> developer. I am not given permission to remote into our servers to
>> execute
>> local scripts.
>>
>> "Jeffery Hicks" <"jhicks[at]SAPIEN.com" wrote:
>>
>>> On Thu, 15 Feb 2007 16:45:03 -0800, mario wrote:
>>>
>>>> Am I doing something wrong? I ran the same command in DOS and
>>>> PowerShell to
>>>> get a simple directory of input XML files, roughly 3500 files, across a
>>>> VPN
>>>> connection. The CMD version took about 2 seconds, the PowerShell took
>>>> SEVERAL
>>>> minutes. I didn't even get to the part where I wanted to sort by a
>>>> property
>>>> and get the last few. I thought powershell froze.
>>>>
>>>> the command was simple:
>>>>
>>>> dir \\someserver\somepath\somesubpath > out.txt
>>>
>>> In PowerShell DIR is an alias for Get-ChildItem. It is not the DIR
>>> command
>>> in CMD. I suspect the VPN tunnel had something to do with poor
>>> performance
>>> in PowerShell, although I don't know what about the cmdlet or .NET would
>>> make that so.
>>>
>>> --
>>> Jeffery Hicks
>>> SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
>>> VBScript & Windows PowerShell Training -
>>> www.ScriptingTraining.com/classes.asp
>>> Windows PowerShell? - www.SAPIENPress.com/powershell.asp
>>>
>>> blog: http://blog.SAPIEN.com
>>> blog: http://jdhitsolutions.blogspot.com
>>>

>
> I suppose you have nothing to lose. So try running the CMD DIR command
> from
> within PowerShell: cmd /c DIR \\server\path
> --
> Jeffery Hicks
> SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
> VBScript & Windows PowerShell Training -
> www.ScriptingTraining.com/classes.asp
> Windows PowerShell? - www.SAPIENPress.com/powershell.asp
>
> blog: http://blog.SAPIEN.com
> blog: http://jdhitsolutions.blogspot.com



My System SpecsSystem Spec
Old 02-16-2007   #6 (permalink)
mario


 
 

Re: PowerShell PAINFULLY SLOW across network

First, I'm really digging this shell despite this performance issue. And
thanks for confirming it's a known issue. Progress is never easy. I'll create
a simple function to parse the output of the CMD dir and from this create an
array of objects with the properties I need.

"Lee Holmes [MSFT]" wrote:

> Thanks, Mario.
>
> This is an issue that we are aware of. It is ultimately due to the way that
> the .NET Framework handles file and directory operations. CMD.exe uses a set
> of features of the Windows API that allow it to collect most file
> information in bulk -- such as the file attributes, name, last modified
> time, etc. The APIs in the .NET Framework, on the other hand request the
> "extended" attribute data, which does not work very well on slow
> connections.
>
> We have thought deeply about this, and the solution will ultimately come
> from the .NET Framework team.
>
> --
> Lee Holmes [MSFT]
> Windows PowerShell Development
> Microsoft Corporation
> This posting is provided "AS IS" with no warranties, and confers no rights.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Windows Network Shares Painfully Slow Vista General
SLOW...good grief, this thing is painfully slow Vista performance & maintenance
2003 Network Share Painfully Slow Vista networking & sharing
Painfully slow network speed Vista networking & sharing
painfully slow Vista hardware & devices


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