Parse env:Path with PowerShell

wp-read-more-redirectwp-read-more-redirectNo Gravatar

The environment variable PATH (combined SYSTEM PATH and USER PATH) can be tricky to parse if you want to check for each folder it contains.  This is due to the support of various formatting styles.  For example, this is a valid PATH statement:

Notice the differences

  • Folder with spaces
  • Folder without spaces
  • Folder with an ending backslash (\)
  • Folder without an ending backslash (\)
  • Folder with a semicolon in the middle
  • Folder with a semicolon at the end
  • Blank folder (;;)

A few references can be found…

But, I could find no simple method to parse this complexity so I wrote a PowerShell Function to handle it.

continue reading on CatapultSystems.com

January 30, 2018

Posted In: Scripting

Tags: ,

GitHub embedding

wp-read-more-redirectwp-read-more-redirectNo Gravatar

This is an example of embedding a GitHub repository script in WordPress using the WP-GitHub plugin (with customized prism.js to add PowerShell, Batch, SQL and AutoIt language support)

And an example of a custom plugin (not yet published) with shortcode: Read More Redirect
continue reading on CatapultSystems.com

January 5, 2017

Posted In: Scripting

Tags: ,