I'm trying to figure out if it's possible to use the parameter -Recurse into Get-ChildItem cmdlet depending on a value of another variable.
I mean, let's say that we have the boolean parameter $flag, if $flag is True I would like to insert the parameter -Recurse into Get-ChildItem execution, otwerwise not.
Many Thanks.