A desktop support technician is creating a PowerShell script (`.ps1`) to automate user account auditing on Windows 11 workstations. The script needs to evaluate whether a string variable containing an account status (`$accountStatus`) is equal to the value `"Disabled"` before taking remediation action. Which of the following comparison operators must the technician use inside the PowerShell `if` conditional statement?
- -eqCevap
- B==
- CEQU
- D-is
Cevap
The technician must use the `-eq` operator inside the PowerShell conditional statement.
PowerShell (`.ps1`) uses hyphenated comparison operators rather than traditional mathematical symbols. The `-eq` operator tests for equality between values or strings within an `if` statement construct.
Adım Adım Çözüm
Anahtar Kavram
PowerShell Conditional Operators and Comparison Syntax