Run uploaded script
  • 14 Oct 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

Run uploaded script

  • Dark
    Light
  • PDF

Article summary

Filter applied to a package

The following PowerShell script determines if the current day of the week is a weekday (Monday through Friday) and, based on that, controls whether the application is visible in the Liquit Workspace. If it is the weekend (Saturday or Sunday), the application should be hidden.

  1. In Liquit Workspace, open the Salesforce package and navigate to Releases > Filters

  2. Create a new filter and in the General tab configure the following:

    • In Type, select Run uploaded filter script.
    • In Script engine, select Windows Powershell.
    • In Script, insert the following:
    $day = (Get-Date).DayOfWeek
    if ($day -ne "Saturday" -or $day -ne "Sunday") {
            return $true
       } else {
          return $false
       }
    
    • In Evaluate, select Value.
    • In Compare, select Equal.
    • In Output, write True.

Filter applied to a package action set

The following PowerShell script ensures that a self-signed certificate required by an MSIX application is installed. If the certificate is missing, install it first, and then proceed with installing the MSIX application. After installing it will launch the MSIX application.

  1. In Liquit Workspace, open a package and navigate to Releases > Actions

  2. Open the Install action and navigate to Filters tab.

  3. Click Create filter set, click Create filter and in the General tab configure the following:

    • In Type, select Run uploaded filter script.
    • In Script engine, select Windows Powershell.
    • In Script, insert the following:
    if (Get-ChildItem -Path Cert:\LocalMachine\TrustedPeople | Where-Object {$_.Thumbprint -eq "A03D24020307E42A2F046940C69929579218D802"})
    {
    return $true
    } else {
           return $false
    }
    
    • In Evaluate, select Value.
    • In Compare, select Equal.
    • In Output, write False.

Was this article helpful?

What's Next