Browse Source

Fixed EditWithPhotosContext function

pull/411/head
Dmitry Nefedov 2 years ago
parent
commit
4573448bcb
  1. 19
      src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
  2. 19
      src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

19
src/Sophia_Script_for_Windows_11/Module/Sophia.psm1

@ -12358,17 +12358,20 @@ function EditWithPhotosContext
$Show
)
if (Get-AppxPackage -Name Microsoft.Windows.Photos)
if ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -le 22623)
{
switch ($PSCmdlet.ParameterSetName)
if (Get-AppxPackage -Name Microsoft.Windows.Photos)
{
"Hide"
{
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc\Shell\ShellEdit -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force
}
"Show"
switch ($PSCmdlet.ParameterSetName)
{
Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc\Shell\ShellEdit -Name ProgrammaticAccessOnly -Force -ErrorAction Ignore
"Hide"
{
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc\Shell\ShellEdit -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force
}
"Show"
{
Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc\Shell\ShellEdit -Name ProgrammaticAccessOnly -Force -ErrorAction Ignore
}
}
}
}

19
src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

@ -12396,17 +12396,20 @@ function EditWithPhotosContext
$Show
)
if (Get-AppxPackage -Name Microsoft.Windows.Photos)
if ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -le 22623)
{
switch ($PSCmdlet.ParameterSetName)
if (Get-AppxPackage -Name Microsoft.Windows.Photos)
{
"Hide"
{
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc\Shell\ShellEdit -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force
}
"Show"
switch ($PSCmdlet.ParameterSetName)
{
Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc\Shell\ShellEdit -Name ProgrammaticAccessOnly -Force -ErrorAction Ignore
"Hide"
{
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc\Shell\ShellEdit -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force
}
"Show"
{
Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc\Shell\ShellEdit -Name ProgrammaticAccessOnly -Force -ErrorAction Ignore
}
}
}
}

Loading…
Cancel
Save