New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTXO: If template not exist, end BIS-F execution #75

Closed
matthias-schlimm opened this Issue Oct 21, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@matthias-schlimm
Copy link
Collaborator

matthias-schlimm commented Oct 21, 2018

During BIS-F sealing, if Citrix Optimizer is enabled and the Template is not found, send Error Output and Exit BIS-F sealing

21.10.2018 08:55:41 | administrator | EXTERNAL LOG.... | Get-Content : Cannot find path 'C:\Program Files
21.10.2018 08:55:42 | administrator | EXTERNAL LOG.... | (x86)\CitrixOptimizer\Templates\EUClab_WindowsServer2016_1607.xml' because it does not exist.

@matthias-schlimm

This comment has been minimized.

Copy link
Collaborator

matthias-schlimm commented Oct 21, 2018

@musklor

This comment has been minimized.

Copy link

musklor commented Oct 29, 2018

Thanks but just one correction
IF (Test-Path "$CTXOTemplatePath$template")
Just miss the XML extension
IF (Test-Path "$CTXOTemplatePath$template.XML")

@matthias-schlimm

This comment has been minimized.

Copy link
Collaborator

matthias-schlimm commented Oct 31, 2018

you're right, but I must doing it here

if ($OSName -like 'Windows 10') {
$ReleaseID = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ReleaseID).ReleaseId
$template = "Citrix_Windows10_$($ReleaseID).xml"
}
elseif ($OSName -like 'Windows 7') {
$template = "Citrix_Windows7_SP1.xml"
}
elseif ($OSName -like 'Windows 8') {
$template = "Citrix_Windows81.xml"
}
elseif ($OSName -like 'Server 2008 R2') {
$template = "Citrix_WindowsServer2008R2.xml"
}
elseif ($OSName -like 'Server 2012 R2') {
$template = "Citrix_WindowsServer2012R2.xml"
}
elseif ($OSName -like 'Server 2016') {
$ReleaseID = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ReleaseID).ReleaseId
$template = "Citrix_WindowsServer2016_$($ReleaseID).xml"
}
elseif ($OSName -like 'Server 2019') {
$ReleaseID = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ReleaseID).ReleaseId
$template = "Citrix_WindowsServer2019_$($ReleaseID).xml"
}
else {
Write-BISFLog -Msg "There is no appropriate Template for $AppName . No optimization by $AppName"
break
}

@musklor

This comment has been minimized.

Copy link

musklor commented Oct 31, 2018

OK but more changes.
Just one question, why don't you use "switch" instead of "if"," if else ".

https://sys-advisor.com/2015/09/27/tips-powershell-comment-utiliser-la-commande-switch/

https://ss64.com/ps/switch.html

Thanks a lot for all your work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment