From 46fa2edf15bde1830036bd46b8ab5e989ec275ab Mon Sep 17 00:00:00 2001 From: Brian Krische <1189328+krische@users.noreply.github.com> Date: Wed, 28 Jun 2023 09:06:48 -0500 Subject: [PATCH] [PATCH] [Windows] Allow JENKINS_URL to not be set when JENKINS_DIRECT_CONNECTION is set (#361) --- jenkins-agent.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins-agent.ps1 b/jenkins-agent.ps1 index 2f354c2ef..c37ccb375 100644 --- a/jenkins-agent.ps1 +++ b/jenkins-agent.ps1 @@ -23,7 +23,7 @@ [CmdletBinding()] Param( $Cmd = '', # this must be specified explicitly - $Url = $( if([System.String]::IsNullOrWhiteSpace($Cmd) -and [System.String]::IsNullOrWhiteSpace($env:JENKINS_URL)) { throw ("Url is required") } else { '' } ), + $Url = $( if([System.String]::IsNullOrWhiteSpace($Cmd) -and [System.String]::IsNullOrWhiteSpace($env:JENKINS_URL) -and [System.String]::IsNullOrWhiteSpace($env:JENKINS_DIRECT_CONNECTION)) { throw ("Url is required") } else { '' } ), [Parameter(Position=0)]$Secret = $( if([System.String]::IsNullOrWhiteSpace($Cmd) -and [System.String]::IsNullOrWhiteSpace($env:JENKINS_SECRET)) { throw ("Secret is required") } else { '' } ), [Parameter(Position=1)]$Name = $( if([System.String]::IsNullOrWhiteSpace($Cmd) -and [System.String]::IsNullOrWhiteSpace($env:JENKINS_AGENT_NAME)) { throw ("Name is required") } else { '' } ), $Tunnel = '',