Skip to content

Commit e305100

Browse files
author
Maddie Clayton
authored
Merge pull request #7332 from maddieclayton/defaultps
Fix default parameter value in psm1
2 parents 68500ee + b2f3b1c commit e305100

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tools/AzureRM.Example.psm1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,17 @@ $FilteredCommands = %DEFAULTRGCOMMANDS%
5454
if ($Env:ACC_CLOUD -eq $null)
5555
{
5656
$FilteredCommands | ForEach-Object {
57-
if (!$global:PSDefaultParameterValues.Contains($_))
57+
58+
$existingDefault = $false
59+
foreach ($key in $global:PSDefaultParameterValues.Keys)
60+
{
61+
if ($_ -like "$key")
62+
{
63+
$existingDefault = $true
64+
}
65+
}
66+
67+
if (!$existingDefault)
5868
{
5969
$global:PSDefaultParameterValues.Add($_,
6070
{

0 commit comments

Comments
 (0)