79500469

Date: 2025-03-11 10:54:16
Score: 1.5
Natty:
Report link

You can doit by using the Null-coalescing assignment operator ??=

$ExistingVar = 'set by script'

$MyPath ??= $env:PWD
$MyVar ??= 'default value'
$ExistingVar ??= 'Cannot set this string to not null vars'

echo $MyPath
echo $MyVar
echo $ExistingVar
Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: LittleEaster