powershell - OR operator for checking branches in Octopus Deploy -
i have 'deploy nuget package' step in octopus. in step, want deploy nuget package , have deployment script executed.
now want deployment happen master , hotfix branches.so added condition in deployemnt script:
if ($branchname.tolower().equals("master") -or $branchname.tolower().contains("hotfix")) { ................... }
but doesn't work , gettin error
'you cannot call method on null-valued expression.'
how can achieve this?
note: don't have pre-deployment , post-deployment script
are able check if $branchname null? can compare strings inbuilt operators:
if ($branchname -and ($branchname -ilike "master" -or $branchname -ilike "*hotfix*")) { ................... }
Comments
Post a Comment