Conditional PowerShell operators -


i trying list title not have temp or temporary or *contractor or contractor*.

this code working, meaning list not have temporary records.

$ptitle = $profile["title"] if ($ptitle -ne "temporary") 

however following code not work when add -or , -notlike wildcard.

$ptitle = $profile["title"] if ($ptitle -ne "temporary" -or $ptitle -notlike "temporary" -or $ptitle -notlike "contractor" -or $ptitle -notlike "temp") 

you want -and here. expression evaluate false if of words found currently.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -