![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 |
| | #2 (permalink) |
| 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 |
| | #3 (permalink) |
| 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 > |
| | #4 (permalink) |
| 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 |
| | #5 (permalink) |
| 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 |
| | #6 (permalink) |
| 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. |
| |
| |
![]() |
| 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 |