For example, in BASH I can write:
# if foo is empty, it will equal 'bar'
foo=${foo:='bar'}
How would I do that in powershell? Ideally, I can set a parameter's default value to an environment variable that defaults to a literal, written for communication purposes in pseudo code:
param(
$foo=${env:foo:='bar'} # in pseudo code
)
How does powershell handle this situation?
paramblock, you would need to use$(...)i.e.:param($foo = $( <# condition inside #> ).... personally wouldn't recommend that, much better to handle this in the blocks. I believe Abdul's link answers this otherwise