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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -