Skip to content

Commit

Permalink
Merge branch 'pr1686' into stable
Browse files Browse the repository at this point in the history
* pr1686:
  (GH-1687) Allow env var in shortcut working dir
  • Loading branch information
ferventcoder committed Mar 13, 2019
2 parents 3cd9c0d + a8fe94c commit 6ab765e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ The full absolute path to the target for new shortcut.
OPTIONAL - The full absolute path of the Working Directory that will be
used by the new shortcut.
As of v0.10.12, the directory will be created unless it contains environment
variable expansion like `%AppData%\FooBar`.
.PARAMETER Arguments
OPTIONAL - Additonal arguments that should be passed along to the new
shortcut.
Expand Down Expand Up @@ -164,7 +167,7 @@ Install-ChocolateyPinnedTaskBarItem
}

if ($workingDirectory) {
if (!(Test-Path($workingDirectory))) {
if ($workingDirectory -notmatch '%\w+%' -and !(Test-Path($workingDirectory))) {
[System.IO.Directory]::CreateDirectory($workingDirectory) | Out-Null
}
}
Expand Down

0 comments on commit 6ab765e

Please sign in to comment.