Breaking $Env:Path into an Array of Paths RRS feed

  • Question

  • Hello Sirs,

    Is there a way to break the $Env:Path into an Array of Paths; so that I can "divide and rule" them!

    Friday, February 22, 2013 3:50 PM


All replies

  • $env:path -split ";"
    BTW, this should be a question, not a discussion.

    Boe Prox
    Blog | PoshWSUS | PoshPAIG | PoshChat

    Friday, February 22, 2013 3:56 PM
  • Oh, thanks. I had tried it, but was certainly making some mistake. Copy/Paste is always great :-)
    Friday, February 22, 2013 4:12 PM
  • Boe's one-line solution works if there are no complexities in the PATH statement.  If there are quoted folder or semicolons in folder then a PowerShell function will do the trick.

    Wednesday, January 31, 2018 11:39 AM