Application of the Week – Microsoft 365 (Part 2)

In Application of the Week – Microsoft 365 (Part 1) I’ve described how to create a package to deploy the desired Channel for Microsoft 365.

In this blog article I will describe how to create the Smart Icons for Microsoft 365 using the ‘Liquit PowerShell Module‘.

Here’s the one for Word:

Import-Module "C:Program Files (x86)Liquit WorkspacePowerShell3.0Liquit.Server.PowerShell.dll" -Prefix "Liquit"
 $liquitZoneUsername = "localadmin"
 $liquitZonePassword = Read-Host "Enter Password" -AsSecureString
 $liquitCredentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $liquitZoneUsername, $liquitZonePassword
 $liquitZone = Read-Host "Enter the uri of your Liquit zone"
 $wordIconURL = "https://www.liquit.com/ico/word.ico"
 $wordIconPath = "c:tempword.ico"
 $packageName = "Word"
 $packageDisplayName = "Word"
 $packageDescription = "Word"
 $liquitContext = Connect-LiquitWorkspace -URI $liquitZone -Credential $liquitCredentials
 $webClient = New-Object System.Net.WebClient
 $webClient.DownloadFile($wordIconURL,$wordIconPath)
 $iconContent = New-LiquitContent -Path $wordIconPath
 $package = New-LiquitPackage -Name $packageName                               -Type "Launch"
                              -DisplayName $packageDisplayName                               -Description $packageDescription
                              -Priority 100                               -Enabled $true
                              -Offline $True                               -Web $false
                              -Icon $iconContent 
 create the snapshot for this package
 $snapshot = New-LiquitPackageSnapshot -Package $package
 define launch action set
 $actionset = New-LiquitActionSet -snapshot $snapshot                                   -Type Launch
                                  -name 'Launch'                                   -Enabled $true
                                  -Frequency Always `
                                  -Process StopAtFirstEffectiveAction
 #
 define the first launch action
 #
 $actionset_action1 = New-LiquitAction -ActionSet $actionset                                        -Name 'Start Word (x86)'
                                       -Type 'processstart'                                        -Enabled $true
                                       -IgnoreErrors $false                                        -Settings @{name = '${ProgramFiles32}Microsoft OfficerootOffice16WINWORD.EXE'; parameters = "";}
                                       -Context User
 define the filter set for the first action
 $filterset1 = New-LiquitFilterSet -Action $actionset_action1
 add a filter to the first action
 $filter1 = new-LiquitFilter -FilterSet $filterset1 -type fileexists -Settings @{path = '${ProgramFiles32}Microsoft OfficerootOffice16WINWORD.EXE';} -Value "true" 
 set the operator for the entity filter to AND
 Set-LiquitEntityFilter -Action $actionset_action1 -Operator Or
 #
 define the second launch action
 #
 $actionset_action2 = New-LiquitAction -ActionSet $actionset                                        -Name 'Start Word (x64)'
                                       -Type 'processstart'                                        -Enabled $true
                                       -IgnoreErrors $false                                        -Settings @{name = '${ProgramFiles}Microsoft OfficerootOffice16WINWORD.EXE'; parameters = "";}
                                       -Context User
 define the filter set for the first action
 $filterset2 = New-LiquitFilterSet -Action $actionset_action2
 add a filter to the first action
 $filter2 = new-LiquitFilter -FilterSet $filterset2 -type fileexists -Settings @{path = '${ProgramFiles}Microsoft OfficerootOffice16WINWORD.EXE';} -Value "true" 
 set the operator for the entity filter to AND
 Set-LiquitEntityFilter -Action $actionset_action1 -Operator Or
 #
 define the third launch action
 #
 $actionset_action3 = New-LiquitAction -ActionSet $actionset                                        -Name 'Word Online'
                                       -Type 'openurl'                                        -Enabled $true
                                       -IgnoreErrors $false                                        -Settings @{ url = 'https://office.live.com/start/Word.aspx'; browser = 3;}
                                       -Context User
 publish the package
 Publish-LiquitPackageSnapshot -Snapshot $snapshot -stage Production 
 set the entitlement
 $identity = Get-LiquitIdentity -id "LOCALeveryone"
 New-LiquitPackageEntitlement -Package $package -Identity $identity -Publish Workspace

and here’s the one for Excel:

Import-Module "C:Program Files (x86)Liquit WorkspacePowerShell3.0Liquit.Server.PowerShell.dll" -Prefix "Liquit"
 $liquitZoneUsername = "localadmin"
 $liquitZonePassExcel = Read-Host "Enter PassExcel" -AsSecureString
 $liquitCredentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $liquitZoneUsername, $liquitZonePassExcel
 $liquitZone = Read-Host "Enter the uri of your Liquit zone"
 $ExcelIconURL = "https://www.liquit.com/ico/excel.ico"
 $ExcelIconPath = "c:tempExcel.ico"
 $packageName = "Excel"
 $packageDisplayName = "Excel"
 $packageDescription = "Excel"
 $liquitContext = Connect-LiquitWorkspace -URI $liquitZone -Credential $liquitCredentials
 $webClient = New-Object System.Net.WebClient
 $webClient.DownloadFile($ExcelIconURL,$ExcelIconPath)
 $iconContent = New-LiquitContent -Path $ExcelIconPath
 $package = New-LiquitPackage -Name $packageName                               -Type "Launch"
                              -DisplayName $packageDisplayName                               -Description $packageDescription
                              -Priority 100                               -Enabled $true
                              -Offline $True                               -Web $false
                              -Icon $iconContent 
 create the snapshot for this package
 $snapshot = New-LiquitPackageSnapshot -Package $package
 define launch action set
 $actionset = New-LiquitActionSet -snapshot $snapshot                                   -Type Launch
                                  -name 'Launch'                                   -Enabled $true
                                  -Frequency Always `
                                  -Process StopAtFirstEffectiveAction
 #
 define the first launch action
 #
 $actionset_action1 = New-LiquitAction -ActionSet $actionset                                        -Name 'Start Excel (x86)'
                                       -Type 'processstart'                                        -Enabled $true
                                       -IgnoreErrors $false                                        -Settings @{name = '${ProgramFiles32}Microsoft OfficerootOffice16Excel.EXE'; parameters = "";}
                                       -Context User
 define the filter set for the first action
 $filterset1 = New-LiquitFilterSet -Action $actionset_action1
 add a filter to the first action
 $filter1 = new-LiquitFilter -FilterSet $filterset1 -type fileexists -Settings @{path = '${ProgramFiles32}Microsoft OfficerootOffice16Excel.EXE';} -Value "true" 
 set the operator for the entity filter to AND
 Set-LiquitEntityFilter -Action $actionset_action1 -Operator Or
 #
 define the second launch action
 #
 $actionset_action2 = New-LiquitAction -ActionSet $actionset                                        -Name 'Start Excel (x64)'
                                       -Type 'processstart'                                        -Enabled $true
                                       -IgnoreErrors $false                                        -Settings @{name = '${ProgramFiles}Microsoft OfficerootOffice16Excel.EXE'; parameters = "";}
                                       -Context User
 define the filter set for the first action
 $filterset2 = New-LiquitFilterSet -Action $actionset_action2
 add a filter to the first action
 $filter2 = new-LiquitFilter -FilterSet $filterset2 -type fileexists -Settings @{path = '${ProgramFiles}Microsoft OfficerootOffice16Excel.EXE';} -Value "true" 
 set the operator for the entity filter to AND
 Set-LiquitEntityFilter -Action $actionset_action1 -Operator Or
 #
 define the third launch action
 #
 $actionset_action3 = New-LiquitAction -ActionSet $actionset                                        -Name 'Excel Online'
                                       -Type 'openurl'                                        -Enabled $true
                                       -IgnoreErrors $false                                        -Settings @{ url = 'https://office.live.com/start/excel.aspx'; browser = 3;}
                                       -Context User
 publish the package
 Publish-LiquitPackageSnapshot -Snapshot $snapshot -stage Production 
 set the entitlement
 $identity = Get-LiquitIdentity -id "LOCALeveryone"
 New-LiquitPackageEntitlement -Package $package -Identity $identity -Publish Workspace