On Mac, the original script doesn't work. Thanks to $([IO.Path]::DirectorySeparatorChar), we can easily provide a standard way to execute correctly this script Tested on Mac OS x High Sierra 10.13.6 PS Version PSVersion: 6.0.0-alpha BuildVersion: 3.0.0.0 GitCommitId: v6.0.0-alpha.9pull/824/head