You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 1. Process all variable contents used by legacy functions
2627
+
# 1. Process all legacy variables
2628
+
foreach ($variableAstin$variableAsts)
2629
+
{
2630
+
$variableName=$variableAst.VariablePath.UserPath
2631
+
$newVariable=$variableMappings[$variableName]
2632
+
2633
+
if ([string]::IsNullOrWhiteSpace($newVariable))
2634
+
{
2635
+
$outputMessage="The variable [`$$variableName] is deprecated and no longer available."
2636
+
$suggestedCorrections=$null
2637
+
}
2638
+
else
2639
+
{
2640
+
if ($newVariable-match'ADTSession')
2641
+
{
2642
+
$outputMessage="The variable [`$$variableName] is now a session variable and no longer directly available. Use [$newVariable] instead."
2643
+
}
2644
+
elseif ($newVariable-match'ADTConfig')
2645
+
{
2646
+
$outputMessage="The variable [`$$variableName] is now a config variable and no longer directly available. Use [$newVariable] instead."
2647
+
}
2648
+
elseif ($newVariable-match'ADTString')
2649
+
{
2650
+
$outputMessage="The variable [`$$variableName] is now a localization string variable and no longer directly available. Use [$newVariable] instead."
2651
+
}
2652
+
else
2653
+
{
2654
+
$outputMessage="The variable [`$$variableName] is deprecated. Use [$newVariable] instead."
2655
+
}
2656
+
2657
+
if ($newVariable-like'*.*'-and$variableAst.Parent.StringConstantType-in [System.Management.Automation.Language.StringConstantType]'DoubleQuoted', [System.Management.Automation.Language.StringConstantType]'DoubleQuotedHereString')
2658
+
{
2659
+
# Wrap variable in $() if it is contains a . and is used in a double-quoted string
2660
+
$newVariable="`$($newVariable)"
2661
+
}
2662
+
2663
+
# Create a CorrectionExtent object for the suggested correction
# 2. Process all variable contents used by legacy functions
2628
2693
foreach ($commandAstin$commandAsts)
2629
2694
{
2630
2695
$functionName=$commandAst.GetCommandName()
@@ -2793,71 +2858,6 @@ function Measure-ADTCompatibility
2793
2858
}
2794
2859
}
2795
2860
2796
-
# 2. Process all legacy variables
2797
-
foreach ($variableAstin$variableAsts)
2798
-
{
2799
-
$variableName=$variableAst.VariablePath.UserPath
2800
-
$newVariable=$variableMappings[$variableName]
2801
-
2802
-
if ([string]::IsNullOrWhiteSpace($newVariable))
2803
-
{
2804
-
$outputMessage="The variable [`$$variableName] is deprecated and no longer available."
2805
-
$suggestedCorrections=$null
2806
-
}
2807
-
else
2808
-
{
2809
-
if ($newVariable-match'ADTSession')
2810
-
{
2811
-
$outputMessage="The variable [`$$variableName] is now a session variable and no longer directly available. Use [$newVariable] instead."
2812
-
}
2813
-
elseif ($newVariable-match'ADTConfig')
2814
-
{
2815
-
$outputMessage="The variable [`$$variableName] is now a config variable and no longer directly available. Use [$newVariable] instead."
2816
-
}
2817
-
elseif ($newVariable-match'ADTString')
2818
-
{
2819
-
$outputMessage="The variable [`$$variableName] is now a localization string variable and no longer directly available. Use [$newVariable] instead."
2820
-
}
2821
-
else
2822
-
{
2823
-
$outputMessage="The variable [`$$variableName] is deprecated. Use [$newVariable] instead."
2824
-
}
2825
-
2826
-
if ($newVariable-like'*.*'-and$variableAst.Parent.StringConstantType-in [System.Management.Automation.Language.StringConstantType]'DoubleQuoted', [System.Management.Automation.Language.StringConstantType]'DoubleQuotedHereString')
2827
-
{
2828
-
# Wrap variable in $() if it is contains a . and is used in a double-quoted string
2829
-
$newVariable="`$($newVariable)"
2830
-
}
2831
-
2832
-
# Create a CorrectionExtent object for the suggested correction
0 commit comments