From 3bff931a790857c86a2fa922c3fe42674c28d307 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Thu, 3 Nov 2022 19:20:52 +0300 Subject: [PATCH] fixed missed brackets --- .../Module/Sophia.psm1 | 30 ++++++++--------- .../Module/Sophia.psm1 | 30 ++++++++--------- .../Module/Sophia.psm1 | 32 +++++++++---------- .../Module/Sophia.psm1 | 32 +++++++++---------- 4 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 index ca1cfa04..49650c68 100644 --- a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 @@ -10797,24 +10797,24 @@ function HEIF $Raw | Select-String -Pattern '.*)"\s.*>(?.*)<\/a>' -AllMatches | ForEach-Object -Process {$_.Matches} | Where-Object -FilterScript {$_.Value -like "*x64*.appx*"} | ForEach-Object -Process { $TempURL = ($_.Groups | Select-Object -Index 1).Value $HEVCPackageName = ($_.Groups | Select-Object -Index 2).Value.Split("_") | Select-Object -Index 1 - } - # Installing "HEVC Video Extensions from Device Manufacturer" - if ([System.Version]$HEVCPackageName -gt [System.Version](Get-AppxPackage -Name Microsoft.HEVCVideoExtension).Version) - { - Write-Verbose -Message $Localization.Patient -Verbose - Write-Verbose -Message $Localization.HEVCDownloading -Verbose + # Installing "HEVC Video Extensions from Device Manufacturer" + if ([System.Version]$HEVCPackageName -gt [System.Version](Get-AppxPackage -Name Microsoft.HEVCVideoExtension).Version) + { + Write-Verbose -Message $Localization.Patient -Verbose + Write-Verbose -Message $Localization.HEVCDownloading -Verbose + + $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" + $Parameters = @{ + Uri = $TempURL + OutFile = "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" + Verbose = $true + } + Invoke-WebRequest @Parameters - $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" - $Parameters = @{ - Uri = $TempURL - OutFile = "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" - Verbose = $true + Add-AppxPackage -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Verbose + Remove-Item -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Force } - Invoke-WebRequest @Parameters - - Add-AppxPackage -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Verbose - Remove-Item -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Force } } catch [System.Net.WebException] diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 index 40c8b288..1ec70478 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 @@ -10835,24 +10835,24 @@ function HEIF $Raw | Select-String -Pattern '.*)"\s.*>(?.*)<\/a>' -AllMatches | ForEach-Object -Process {$_.Matches} | Where-Object -FilterScript {$_.Value -like "*x64*.appx*"} | ForEach-Object -Process { $TempURL = ($_.Groups | Select-Object -Index 1).Value $HEVCPackageName = ($_.Groups | Select-Object -Index 2).Value.Split("_") | Select-Object -Index 1 - } - # Installing "HEVC Video Extensions from Device Manufacturer" - if ([System.Version]$HEVCPackageName -gt [System.Version](Get-AppxPackage -Name Microsoft.HEVCVideoExtension).Version) - { - Write-Verbose -Message $Localization.Patient -Verbose - Write-Verbose -Message $Localization.HEVCDownloading -Verbose + # Installing "HEVC Video Extensions from Device Manufacturer" + if ([System.Version]$HEVCPackageName -gt [System.Version](Get-AppxPackage -Name Microsoft.HEVCVideoExtension).Version) + { + Write-Verbose -Message $Localization.Patient -Verbose + Write-Verbose -Message $Localization.HEVCDownloading -Verbose + + $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" + $Parameters = @{ + Uri = $TempURL + OutFile = "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" + Verbose = $true + } + Invoke-WebRequest @Parameters - $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" - $Parameters = @{ - Uri = $TempURL - OutFile = "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" - Verbose = $true + Add-AppxPackage -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Verbose + Remove-Item -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Force } - Invoke-WebRequest @Parameters - - Add-AppxPackage -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Verbose - Remove-Item -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Force } } catch [System.Net.WebException] diff --git a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 index af55f5dc..2924164c 100644 --- a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 @@ -184,7 +184,7 @@ function Checks } # Check whether LGPO.exe exists in the bin folder - if (-not (Test-Path -Path "$PSScriptRoot\..\bin\LGPO.exe") + if (-not (Test-Path -Path "$PSScriptRoot\..\bin\LGPO.exe")) { Write-Warning -Message $Localization.Bin Start-Sleep -Seconds 5 @@ -10216,24 +10216,24 @@ function HEIF $Raw | Select-String -Pattern '.*)"\s.*>(?.*)<\/a>' -AllMatches | ForEach-Object -Process {$_.Matches} | Where-Object -FilterScript {$_.Value -like "*x64*.appx*"} | ForEach-Object -Process { $TempURL = ($_.Groups | Select-Object -Index 1).Value $HEVCPackageName = ($_.Groups | Select-Object -Index 2).Value.Split("_") | Select-Object -Index 1 - } - # Installing "HEVC Video Extensions from Device Manufacturer" - if ([System.Version]$HEVCPackageName -gt [System.Version](Get-AppxPackage -Name Microsoft.HEVCVideoExtension).Version) - { - Write-Verbose -Message $Localization.Patient -Verbose - Write-Verbose -Message $Localization.HEVCDownloading -Verbose + # Installing "HEVC Video Extensions from Device Manufacturer" + if ([System.Version]$HEVCPackageName -gt [System.Version](Get-AppxPackage -Name Microsoft.HEVCVideoExtension).Version) + { + Write-Verbose -Message $Localization.Patient -Verbose + Write-Verbose -Message $Localization.HEVCDownloading -Verbose + + $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" + $Parameters = @{ + Uri = $TempURL + OutFile = "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" + Verbose = $true + } + Invoke-WebRequest @Parameters - $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" - $Parameters = @{ - Uri = $TempURL - OutFile = "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" - Verbose = $true + Add-AppxPackage -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Verbose + Remove-Item -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Force } - Invoke-WebRequest @Parameters - - Add-AppxPackage -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Verbose - Remove-Item -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Force } } catch [System.Net.WebException] diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 index 8f2e06a5..fb410663 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 @@ -184,7 +184,7 @@ function Checks } # Check whether LGPO.exe exists in the bin folder - if (-not (Test-Path -Path "$PSScriptRoot\..\bin\LGPO.exe") + if (-not (Test-Path -Path "$PSScriptRoot\..\bin\LGPO.exe")) { Write-Warning -Message $Localization.Bin Start-Sleep -Seconds 5 @@ -10254,24 +10254,24 @@ function HEIF $Raw | Select-String -Pattern '.*)"\s.*>(?.*)<\/a>' -AllMatches | ForEach-Object -Process {$_.Matches} | Where-Object -FilterScript {$_.Value -like "*x64*.appx*"} | ForEach-Object -Process { $TempURL = ($_.Groups | Select-Object -Index 1).Value $HEVCPackageName = ($_.Groups | Select-Object -Index 2).Value.Split("_") | Select-Object -Index 1 - } - # Installing "HEVC Video Extensions from Device Manufacturer" - if ([System.Version]$HEVCPackageName -gt [System.Version](Get-AppxPackage -Name Microsoft.HEVCVideoExtension).Version) - { - Write-Verbose -Message $Localization.Patient -Verbose - Write-Verbose -Message $Localization.HEVCDownloading -Verbose + # Installing "HEVC Video Extensions from Device Manufacturer" + if ([System.Version]$HEVCPackageName -gt [System.Version](Get-AppxPackage -Name Microsoft.HEVCVideoExtension).Version) + { + Write-Verbose -Message $Localization.Patient -Verbose + Write-Verbose -Message $Localization.HEVCDownloading -Verbose + + $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" + $Parameters = @{ + Uri = $TempURL + OutFile = "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" + Verbose = $true + } + Invoke-WebRequest @Parameters - $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" - $Parameters = @{ - Uri = $TempURL - OutFile = "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" - Verbose = $true + Add-AppxPackage -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Verbose + Remove-Item -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Force } - Invoke-WebRequest @Parameters - - Add-AppxPackage -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Verbose - Remove-Item -Path "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" -Force } } catch [System.Net.WebException]