-
Notifications
You must be signed in to change notification settings - Fork 0
/
HideNewOutlookToggle
23 lines (20 loc) · 960 Bytes
/
HideNewOutlookToggle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Check for the following registry key and if not present, create it
$registryKey = "HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Options\General"
if (Test-Path $registryKey) {
# The registry key already exists
} else {
# The registry key does not exist, so create it
New-Item $registryKey
}
# Check for the following DWORD setting "HideNewOutlookToggle" in HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Options\General
$hideNewOutlookToggle = Get-ItemProperty -Path $registryKey -Name HideNewOutlookToggle
if ($hideNewOutlookToggle -eq $null) {
# The DWORD setting does not exist, so create it
Set-ItemProperty -Path $registryKey -Name HideNewOutlookToggle -Value 1
} else {
# The DWORD setting exists, so check its value
if ($hideNewOutlookToggle -ne 1) {
# The DWORD setting is not set to 1, so set it to 1
Set-ItemProperty -Path $registryKey -Name HideNewOutlookToggle -Value 1
}
}