![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| Guest | how do I keep powershells current directory and dotnets current directory in sync System.IO.FileInfo and every dotnet function has a current directory, that is different from what powershell thinks is the current directory. [system.Environment]::CurrentDirectory = (convert-path ".") puts it in sync once, but after every cd everything is wrong again Calling Convert-Path before using a dotnet function is extremely tedious and error prone. Harald |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: how do I keep powershells current directory and dotnets current di I know this came up before. Maybe a workaround has already been posted here or in the old newsgroup microsoft.public.windows.server.scripting some month ago. I'm not quite sure, but AFAIK there is no easy solution for this. Using a new custom "cd" function that can sync the current directory might be a solution. Note that you need to filter out directories on drives like env: hklm: cert: etc. as they can not be used as [system.Environment]::CurrentDirectory. -- greetings dreeschkind "Harald Ums (2179630)" wrote: > System.IO.FileInfo and every dotnet function has a current directory, that > is different from what powershell thinks is the current directory. > > [system.Environment]::CurrentDirectory = (convert-path ".") > > puts it in sync once, but after every cd everything is wrong again > Calling Convert-Path before using a dotnet function is extremely tedious and > error prone. > > Harald > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| How can I Write-Host the current directory? | PowerShell | |||
| Difference in getting the current exe directory | .NET General | |||
| bug in join-path when the current directory is used | PowerShell | |||
| Executing scripts in the current directory | PowerShell | |||
| Manipulating current directory as a variable | PowerShell | |||