How do I replace spaces with in PowerShell?

前端 未结 4 1622
终归单人心
终归单人心 2020-12-29 18:47

I\'m creating a PowerShell script that will assemble an HTTP path from user input. The output has to convert any spaces in the user input to the product specific codes, \"%2

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-29 19:14

    To replace " " with %20 and / with %2F and so on, do the following:

    [uri]::EscapeDataString($SitePath)
    

提交回复
热议问题