if (Get-ChildItem $sqlpsreg -ErrorAction "SilentlyContinue")
$0$0
$0
$0should be$0
$0$0
$0
$0if (-not (Get-ChildItem $sqlpsreg -ErrorAction "SilentlyContinue") )$0
$0$0
$0
$0otherwise you're always skipping the check. Also, since you're throwing an error there is no need for an else block.$0
↧