Powershell supports standard conditional logic operators, much like many programming languages. These allow certain functions or commands to be run under particular circumstances.
With an if the commands inside the brackets ({}) are only executed if the conditions inside the if(()) are met
$test =...