Terminal.ps1
. "./Global.psm1" $TerminalPackageName = "B158BDD8.LogetoTerminal" $ServicePackageName = "Logeto.UWP.Service" <# Return Json file for Terminal appx, if there is no newer version null is returned. #> function Get-LogetoTerminalUpdateInfo { $productPrefix = "logeto-terminal" $scope = Get-LogetoScope $appxVersion = Get-LogetoAppxVersion $TerminalPackageName return Get-LogetoUpdateInfo -Product $productPrefix -Scope $scope -Version $appxVersion } <# Return Json file from the URL for set product and scope. If version parameter is set it returns Json file only if higher version was found, otherwise returns null. #> function Set-TerminalPrepareEnvironment { Param( [parameter(Mandatory=$false)] $ProductName = 'logeto-terminal' ) $keyname = "AllowAllTrustedApps" $regname = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" if (Test-Path $regname) { $regvalue = (Get-ItemProperty -Path $regname).$keyname if ($regvalue -lt 1) { New-ItemProperty -Path $regname -Name $keyname -Value 1 -PropertyType DWORD -Force } } $keyname = "LogetoTerminal" $regname = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" $fullpath = $regname + "\" + $keyname if (-Not (Test-Path $fullpath)) { New-Item -Path $regname -Name $keyname } New-ItemProperty -Path $fullpath -Name "DisplayName" -Value "Logeto Terminal" -Force $value = $TerminalFolder + $ProductName + "\Uninstall\LogetoInstaller.exe -uninstallAsCurrentUser" New-ItemProperty -Path $fullpath -Name "UninstallString" -Value $value -Force New-ItemProperty -Path $fullpath -Name "Publisher" -Value "Systemart s.r.o." -Force $value = $TerminalFolder + $ProductName + "\Uninstall\ProductLogo.ico" New-ItemProperty -Path $fullpath -Name "DisplayIcon" -Value $value -Force } |