![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | bug in join-path when the current directory is used 1) Is there a FAQ either on this forum or connect.microsoft on what format to use when submitting bugs? 2) Has someone previously posted a problem with how join-path handles the current directory? To give an example assume that the current directory of drive d: is Users c: cd d: d:\users c: dir d: d--- bob .... Passing the following parameters to join-path does not return the expected results. It should be dumping out the contents of my folder since its a child of the Users directory. c:>join-path d: bob | dir The reason is join-path blindly adds the path-seperator when concatenating the two parameters. join-path should be checking whether the first parameter ends in a colon and if so concatenate the parameter without the path-seperator. thx bob |
My System Specs![]() |
| | #2 (permalink) |
| | Re: bug in join-path when the current directory is used 1. You can submit a new bug or suggestion on Mcrosoft connect http://connect.microsoft.com 2. Can't remember ![]() 3. Mabe this can help - http://blogs.msdn.com/powershell/arc...join-path.aspx HTH Shay http://scriptolog.blogspot.com Quote: > 1) Is there a FAQ either on this forum or connect.microsoft on what > format to use when submitting bugs? > > 2) Has someone previously posted a problem with how join-path handles > the current directory? > > To give an example assume that the current directory of drive d: is > Users > > c: cd d: > d:\users > c: dir d: > > d--- bob > ... > Passing the following parameters to join-path does not return the > expected results. It should be dumping out the contents of my folder > since its a child of the Users directory. > > c:>join-path d: bob | dir > > The reason is join-path blindly adds the path-seperator when > concatenating the two parameters. > > join-path should be checking whether the first parameter ends in a > colon and if so concatenate the parameter without the path-seperator. > > thx > bob |
My System Specs![]() |
| | #3 (permalink) |
| | Re: bug in join-path when the current directory is used A work around: join-path (get-item d bob | dir....with alias join-path (gi d bob | dir-- Kiron |
My System Specs![]() |
| | #4 (permalink) |
| | Re: bug in join-path when the current directory is used Thanks Kiron I didn't think of this work around. The one which I used when I wrote a batchfile function to handle embedded spaces more than one backslash as part of the drive letter and of course this issue was to do the check whether the drive was passed in only Adding a . to the drive will also work. c:.\ But all of these require one to parse the paths and take corrective action which is what join-path is supposed to do. "Kiron" wrote: Quote: > A work around: > join-path (get-item d bob | dir> > ....with alias > join-path (gi d bob | dir> > -- > Kiron > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: bug in join-path when the current directory is used > Adding a . to the drive will also work. c:.\ That's a better (shorter) work around, you don't need the '\' after the dot though join-path d:. bob | dir -- Kiron |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Why behaves Join-Path not the pythonic way | PowerShell | |||
| How can I Write-Host the current directory? | PowerShell | |||
| Difference in getting the current exe directory | .NET General | |||
| how do I keep powershells current directory and dotnets current directory in sync | PowerShell | |||
| Errors in Help file for join-path | PowerShell | |||