Comment puis-je annuler une condition dans PowerShell?

Comment puis-je annuler un test conditionnel dans PowerShell?

Par exemple, si je veux vérifier pour le répertoire C:\Code, je peux courir:

if (Test-Path C:\Code){
  write "it exists!"
}

Est-il un moyen de contrer cette condition, par exemple (non-travail):

if (Not (Test-Path C:\Code)){
  write "it doesn't exist!"
}

Solution de contournement:

if (Test-Path C:\Code){
}
else {
  write "it doesn't exist"
}

Cela fonctionne bien, mais je préfère quelque chose en ligne.