I'm learning PowerShell and trying to set variable values inside a loop. Using these strings:
$Apple = 'Apple'
$Banana = 'Banana'
$Orange = 'Orange'
I'm trying to join the strings inside a loop:
$Fruits = @($Apple, $Banana, $Orange)
foreach ($Fruit in $Fruits)
{
$Fruit = $Fruit + '.' + "Test"
$Fruit
}
This works inside the scope of the loop. But how can I set the value of $Apple, $Banana and $Orange permanently?