This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # Deploy tasks | |
| - name: "Deploy role {{ role_name }}" | |
| debug: | |
| msg: "################ This role {{ role_name }} is being run in deploy mode and will make changes if it has to! ################" | |
| - set_fact: | |
| citrix_vda_installer_zip: "XenDesktop{{citrix_vda_version}}-subset-for-vda.zip" | |
| citrix_vda_installer_zip_full: "{{temp_folder}}/XenDesktop{{citrix_vda_version}}-subset-for-vda.zip" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This will return a hash of an individual file or of a folder, optionally recursing folders | |
| # Folder processing logic (sorting on fullname and using fullname as part of agglomerated string) is trying to guard against possibility of things like | |
| # filename changes but order staying the same | |
| # | |
| function Get-SpecialHash( $_file_pattern, $_recurse=$false ) { | |
| if ( -Not (Test-Path $_file_pattern) ) { return Return-HashResult $false 0 "file pattern did not find files $_file_pattern" } | |
| if ( $_recurse ) { $_files = Get-ChildItem $_file_pattern -recurse | Sort-Object -Property Fullname } | |
| else { $_files = Get-ChildItem $_file_pattern | Sort-Object -Property Fullname } | |
| if ( -Not $_files ) { return Return-HashResult $false 0 "file pattern did not find files $_file_pattern" } | |
| if ( $_files.count -eq 1 ) { return Return-HashResult $true 1 "found one file based on pattern $_file_pattern" (Get-FileHash $_files.fullname -Algorithm MD5).hash } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-DisplayVersion( $_displayNamePartial ) { | |
| $_displayNameEscaped = [System.Text.RegularExpressions.Regex]::Escape($_displayNamePartial) # to handle things like 'Microsoft Visual C++ 2013 x86 Additional Runtime' - https://lazywinadmin.com/2014/09/powershell-tip-escape-regex.html | |
| $_results = @() | |
| $_result = (Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object { $_.DisplayName -match "$_displayNameEscaped" }) | Select-Object -Property DisplayName,DisplayVersion | |
| if ( $_result ) { $_results += $_result } | |
| $_result = (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object { $_.DisplayName -match "$_displayNameEscaped" }) | Select-Object -Property DisplayName,DisplayVersion | |
| if ( $_result ) { $_results += $_result } | |
| if ( $_results.count -eq 0 ) { return (DisplayVersion-Results $false "no instances found for display name $_displayNamePartial" ) } | |
| if ( $_results.count -gt 1 ) { return (DisplayVersion-Results |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-DisplayVersion( $_displayNamePartial ) { | |
| $_displayNameEscaped = [System.Text.RegularExpressions.Regex]::Escape($_displayNamePartial) # to handle things like 'Microsoft Visual C++ 2013 x86 Additional Runtime' - https://lazywinadmin.com/2014/09/powershell-tip-escape-regex.html | |
| $_results = @() | |
| $_result = (Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object { $_.DisplayName -match "$_displayNameEscaped" }) | Select-Object -Property DisplayName,DisplayVersion | |
| if ( $_result ) { $_results += $_result } | |
| $_result = (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object { $_.DisplayName -match "$_displayNameEscaped" }) | Select-Object -Property DisplayName,DisplayVersion | |
| if ( $_result ) { $_results += $_result } | |
| if ( $_results.count -eq 0 ) { return (DisplayVersion-Object $false "no instances found for display name $_displayNamePartial" ) } | |
| if ( $_results.count -gt 1 ) { |