I am having following variables in my powershell script
$Buildlog="FormalBuild.log"
$Logger="/flp1:Append;LogFile=$Buildlog;Verbosity=Diag;"
#Logger will use Formalbuild.log
Write-host $logger
$Buildlog="Dailybuild.log"
#Logger should use Dailybuild.log file
Write-host $logger
$logger always displays Formalbuild.log. I do not want to redefine logger again. Is there any way to make the $logger value dynamic?
Look for example here: http://powershell.com/cs/blogs/tips/archive/2011/10/31/creating-intelligent-variables.aspx
Then the code snippet might be: