Forum Discussion

RonaldvdMeer's avatar
RonaldvdMeer
Iron Contributor
Sep 09, 2018

Installing programs with Powershell not always consistant

We installing a few programs with Powershell because they are not single MSI

 

Whe use the script that is mentioned at this page https://stealthpuppy.com/deploy-citrix-receiver-intune/#.W5UiIkUzbOQ and edit to install other software.

 

Now we have experienced that this is running and the status in Intune shows succeeded. But sometimes the software is not always installed even though the status shows succeeded.

 

Is there any way to check if the software is really installed.  My experience is that if the status shows succeeded the script doesn't run any more and the software never gets installed

  • RonaldvdMeer's avatar
    RonaldvdMeer
    Iron Contributor

    I added a do while statement to the script so the script will keep trying to install until the program is installed. Below is the complete script. Can anyone confirm if this is the correct way to this.

     

    <#

    .SYNOPSIS

        Downloads and installs Citrix WorkspaceApp.

        Intended to run via Intune.

    #>

     

    do{

    # If WorkspaceApp is already installed, skip download and install

    If  ((!(Get-WmiObject -Class Win32_Product | Where-Object Name -Like "Citrix Workspace*"))) {

     

        # Citrix Workspace App download source

        $Url = "https://downloadplugins.citrix.com/Windows/CitrixWorkspaceApp.exe"

        $Target = "$env:SystemRoot\Temp\CitrixWorkspaceApp.exe"

     

        # Delete the target if it exists, so that we don't have issues

        If (Test-Path $Target) { Remove-Item -Path $Target -Force -ErrorAction SilentlyContinue }

     

        # Download Citrix Receiver locally

        Start-BitsTransfer -Source $Url -Destination $Target

     

        # Install Citrix Receiver

        If (Test-Path $Target) { Start-Process -FilePath $Target -ArgumentList "/AutoUpdateCheck=auto /AutoUpdateStream=Current /AllowAddStore=N /DeferUpdateCount=5 /AURolloutPriority=Medium /NoReboot /Silent EnableCEIP=False" -Wait }

     

     

        }

    } while ((!(Get-WmiObject -Class Win32_Product | Where-Object Name -Like "Citrix Workspace*")))

Resources