How to normalize a path in PowerShell?

后端 未结 12 2104
半阙折子戏
半阙折子戏 2020-12-05 03:53

I have two paths:

fred\\frog

and

..\\frag

I can join them together in PowerShell like this:



        
12条回答
  •  旧时难觅i
    2020-12-05 04:06

    Well, one way would be:

    Join-Path 'fred\frog' '..\frag'.Replace('..', '')
    

    Wait, maybe I misunderstand the question. In your example, is frag a subfolder of frog?

提交回复
热议问题