Worklet: Citrix Application Update

This worklet looks at the Registry Key that Citrix uses when it is installed. This is the newest version that was released in Feb but can be changed accordingly. This does require the installation file to be uploaded to the policy but this is used to keep everyone on the same version.

The evaluation code:

#Current version of Citrix can be modified.
$Version = "21.2.0.17"

If((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Wow6432Node\Citrix\Dazzle" -Name "Version") -eq $Version) {
write-output = "Version is up to date"
Exit 0
}else{ 
    write-output = "Running Update"
    exit 30

The Remediation Code:#installs silently, disables the server question as well as autoupdate policy

if((test-path -Path "c:\Citrix\CitrixWorkspaceApp2102.exe") -eq $false) {
md c:\Citrix
Copy-Item .\CitrixWorkspaceApp2102.exe -Destination "c:\Citrix\CitrixWorkspaceApp2102.exe"
Write-Output = "File copied"
}else {
Write-Output = "File already copied"
}
Start-Process -FilePath "c:\Citrix\CitrixWorkspaceApp2102.exe" -ArgumentList "/silent /ALLOWADDSTORE=N /AutoUpdateCheck=disabled"
Write-output = "Installed Application"

The reason it is being copied is if it needs to be reinstalled due to any issues and would be available to the techs as a general install path. The Auto Update was broken on the last update and causing JSON errors when users attempted to update the file. The outputs show in the report views so to monitor the status of the test groups.