![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| | #3 (permalink) |
| | 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 Specs![]() |
| | #4 (permalink) |
| | 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 Specs![]() |
| | #5 (permalink) |
| | 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 Specs![]() |
| | #6 (permalink) |
| | 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 Specs![]() |
![]() |
| 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 | |||