35 lines
1.4 KiB
PowerShell
35 lines
1.4 KiB
PowerShell
$ErrorActionPreference = "Continue"
|
|
try {
|
|
$checkIfExist = New-ItemProperty HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Calendar\ EnableMeetingCopy -ErrorAction "Stop"
|
|
echo "Return value of New property:" $chekIfExist
|
|
}
|
|
catch {
|
|
echo "Property already exist check value"
|
|
$ret = Get-ItemPropertyValue HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Calendar\ EnableMeetingCopy
|
|
echo $ret
|
|
if($ret -eq 1)
|
|
{
|
|
echo "[NOCHANGE]setting is correct"
|
|
}
|
|
else
|
|
{
|
|
echo "Attempt to write registry to 1..."
|
|
Set-ItemProperty HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Calendar\ EnableMeetingCopy 1
|
|
echo "check for result..."
|
|
$ret2 = Get-ItemProperyValue HKCU:\Software\Microsoft\Office\16.0\Outlook\Options\Calendar\ EnableMeetingCopy
|
|
if($ret2 == 1)
|
|
{
|
|
echo "success value set, restart outlook"
|
|
}
|
|
else
|
|
{
|
|
echo "[error] could not set or invalid value returned"
|
|
echo $ret2
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
echo "done"
|