Error on Citrix server

When using the script on a citrix server, we recieve the error below.

The line 155 points to the logfile(location) but using the parameter -DisableLogging doesn’t fix it.

Anyone got an idea?

PS C:\package\Visual Studio Code\Package> .\Deploy-Application.ps1 -DeploymentType "Install" -DeployMode "Interactive"
C:\package\Visual Studio Code\Package\Deploy-Application.ps1 : Module [C:\package\Visual Studio Code\Package\AppDeployToolkit\AppDeployToolkitMain.ps1] failed to load:
Cannot convert value "" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0.

At C:\package\Visual Studio Code\Package\Deploy-Application.ps1:155 char:13
+             . $moduleAppDeployToolkitMain
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At line:1 char:1
+ .\Deploy-Application.ps1 -DeploymentType "Install" -Deploymode "Inter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Deploy-Application.ps1

You are trying to run this chunk of code in Deploy-Application.ps1:

        [String]$moduleAppDeployToolkitMain = "$scriptDirectory\AppDeployToolkit\AppDeployToolkitMain.ps1"
        If (-not (Test-Path -LiteralPath $moduleAppDeployToolkitMain -PathType 'Leaf')) {
            Throw "Module does not exist at the specified location [$moduleAppDeployToolkitMain]."
        }
        If ($DisableLogging) {
            . $moduleAppDeployToolkitMain -DisableLogging
        }
        Else {
            . $moduleAppDeployToolkitMain
        }

It seems like $moduleAppDeployToolkitMain is empty. line 147 is not working.

Do you have a \AppDeployToolkit\ folder?

Yes is have, the script is working fine on a Windows client. But when deploying on server, the error occurs.

This doesn’t make sense.

The code does a Test-Path $moduleAppDeployToolkitMain to make sure $moduleAppDeployToolkitMain points to a file.

but when it reaches the line to Dot-Source $moduleAppDeployToolkitMain, $moduleAppDeployToolkitMain becomes null?

Maybe Reboot your Citrix server?
I think your PowerShell environment is screwed up on your Citrix.

Still got this problem, no solution found yet.
It’s not on one Citrix server, it;s on all servers.