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

PowerShell PAINFULLY SLOW across network

Closed Thread
 
Thread Tools Display Modes
Old 02-15-2007   #1 (permalink)
mario
Guest


 

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


Old 02-16-2007   #2 (permalink)
Jeffery Hicks
Guest


 

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
Old 02-16-2007   #3 (permalink)
mario
Guest


 

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
>

Old 02-16-2007   #4 (permalink)
Jeffery Hicks
Guest


 

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
Old 02-16-2007   #5 (permalink)
Lee Holmes [MSFT]
Guest


 

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



Old 02-16-2007   #6 (permalink)
mario
Guest


 

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.


Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
SLOW...good grief, this thing is painfully slow Les Thompson Vista performance & maintenance 6 03-25-2007 10:15 PM
Windows Network Shares Painfully Slow rennera Vista General 11 02-13-2007 08:30 AM
2003 Network Share Painfully Slow rennera Vista networking & sharing 3 12-29-2006 10:53 AM
Painfully slow network speed =?Utf-8?B?TWlrZQ==?= Vista networking & sharing 0 09-17-2006 08:41 PM
painfully slow BIA Vista hardware & devices 7 06-21-2006 01:47 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