silence script output

This commit is contained in:
2021-03-22 15:42:21 -04:00
parent ff55ab63f1
commit da1479b96b
+2 -2
View File
@@ -1,7 +1,7 @@
$REG_PATH = 'HKCU:\SOFTWARE\Microsoft\Exchange'
$REG_PROP = 'AlwaysUseMSOAuthForAutoDiscover'
If ( !((Get-ItemProperty -Path $REG_PATH -Name $REG_PROP).$REG_PROP) ) {
If ( !((Get-ItemProperty -Path $REG_PATH -Name $REG_PROP -ErrorAction SilentlyContinue).$REG_PROP) ) {
LogMsg "Adding registry entry: ""${REG_PATH}\${REG_PROP}"" = 1"
Try { New-ItemProperty -Path $REG_PATH -Name $REG_PROP -PropertyType DWord -Value 1 }
Try { New-ItemProperty -Path $REG_PATH -Name $REG_PROP -PropertyType DWord -Value 1 | Out-Null }
Catch { LogErr $_.Exception.Message }
}