Esri / arcgis-powershell-dsc

This repository contains scripts, code and samples for automating the install and configuration of ArcGIS (Enterprise and Desktop) using Microsoft Windows PowerShell DSC (Desired State Configuration).
Apache License 2.0
110 stars 61 forks source link

Problem WebAdaptor Java with Version #503

Closed jrascle closed 4 months ago

jrascle commented 7 months ago

Community Note

Module Version

4.2.0

Affected Resource(s)

ArcGIS WebAdaptor

Version Base deployment

10.9.1

Problem

#For JAVA Web Adaptor we will always require AGSWEBADAPTORHOME to be set. $AGSWEBADAPTORHOME_Path = [environment]::GetEnvironmentVariable("AGSWEBADAPTORHOME","Machine") if([string]::IsNullOrEmpty($AGSWEBADAPTORHOME_Path)){ throw "AGSWEBADAPTORHOME environment variable is not set." }

The variable $AGSWEBADAPTORHOME_Path seems useless.

$JavaWAInstalls = (Get-ArcGISProductDetails -ProductName "ArcGIS Web Adaptor (Java Platform) $($Version)") $InstallObject = ($JavaWAInstalls | Select-Object -First 1) if($InstallObject.Version -imatch $Version){ $WAConfigFolder = Join-Path $InstallObject.InstallLocation $Context $WAConfigPath = Join-Path $WAConfigFolder 'webadaptor.config' if((Test-Path $WAConfigFolder) -and (Test-Path $WAConfigPath)){ [xml]$WAConfig = Get-Content $WAConfigPath $WAConfigSiteUrl = if($Component -ieq "Portal"){ $WAConfig.Config.WebServer.Portal.URL }else{ $WAConfig.Config.WebServer.GISServer.SiteURL } }else{ Write-Verbose "No config file found for webadaptor at '$($WAConfigFolder)'" $result = $False } }else{ throw "Installed Java Web Adaptor version doesn't match $Version" }

The comparison of version with -imatch doesn't work with AGE 10.9.1.

image

cameronkroeker commented 4 months ago

Hi @jrascle,

This issue has been addressed in module v4.2.1:

https://github.com/Esri/arcgis-powershell-dsc/releases/tag/v4.2.1

Thanks, Cameron K.