Skip to content

Commit f124a36

Browse files
authored
Update ConnectorPackageValidator.ps1 (#3744)
Change the message for presence of 'Workflows' in AIPlugin solution
1 parent f70d160 commit f124a36

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

scripts/ConnectorPackageValidator.ps1

+14-5
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ try {
326326
$isConnectorSolutionPresent= $false
327327
$isFlowSolutionPresent = $false
328328
$isPluginSolutionPresent = $false
329+
$isWorkflowsInPlugin= $false
329330
foreach ($secondLevelZipFile in $secondLevelZipFiles) {
330331
$isConnectorFound = $false
331332
$isWorkflowsFound = $false
@@ -407,6 +408,9 @@ try {
407408
if (($isConnectorFound) -and (-not $isWorkflowsFound) -and ($isPluginFound)) {
408409
$isPluginSolutionPresent = $true
409410
}
411+
if (($isConnectorFound) -and ($isWorkflowsFound) -and ($isPluginFound)) {
412+
$isWorkflowsInPlugin= $true
413+
}
410414
# check if the connector folder name is present with the same name
411415
if ($isConnectorFound) {
412416
$connectorFolder = Get-ChildItem -Path "$tempFolder3" -Directory | Where-Object {$_.Name -eq $connectorNodeName}
@@ -455,7 +459,7 @@ try {
455459

456460
if ((-not $connectorFolder) -or (-not $nodeNameFolder1) -or (-not $nodeNameFolder2)) {
457461
$folderNameMissing = if ((-not $nodeNameFolder1) -and $connectorFolder -and $nodeNameFolder2) {"folder namely '$folderNameToCheck1'"} elseif ((-not $connectorFolder) -and $nodeNameFolder1 -and $nodeNameFolder2) {"folder namely '$connectorNodeName"} elseif ((-not $nodeNameFolder2) -and $connectorFolder -and $nodeNameFolder2) {"folder namely '$folderNameToCheck2"} elseif ((-not $nodeNameFolder1) -and (-not $connectorFolder) -and $nodeNameFolder2) {"folders namely '$connectorNodeName', '$folderNameToCheck1'"} elseif ((-not $nodeNameFolder2) -and (-not $connectorFolder) -and $nodeNameFolder1) {"folders namely '$connectorNodeName', '$folderNameToCheck2'"} elseif ((-not $nodeNameFolder1) -and (-not $nodeNameFolder2) -and $connectorFolder) {"folders namely '$folderNameToCheck1', '$folderNameToCheck2'"} else {"folders namely '$connectorNodeName', '$folderNameToCheck1'. '$folderNameToCheck2'"}
458-
Write-Host "The solution zip file '$secondLevelZipFile' in '$originalParentFolderPath' should contain '$folderNameMissing"
462+
Write-Host "The solution zip file '$secondLevelZipFile' in '$originalParentFolderPath' should contain '$folderNameMissing'"
459463
Write-Host "The folders should match the customization.xml file. They are present by default in an exported solution and should not be modified/removed manually."
460464
Write-Host "Please add the required folders to the solution zip or export the correct solution again."
461465
DisplayReferDocumentation
@@ -468,8 +472,7 @@ try {
468472
exit
469473
}
470474
}
471-
}
472-
write-Host "****** isPluginEnabled: $isPluginEnabled, isBoolPluginEnabled: $isBoolPluginEnabled ******"
475+
}
473476
if (-not $isConnectorSolutionPresent) {
474477
Write-Host "Connector solution in '$originalParentFolderPath' is invalid. Connector solution should only contain 'Connector' folder."
475478
Write-Host "Validate the connector solution has no extra component except 'Connector'. If not so, please remove them from the solution and export again."
@@ -481,8 +484,14 @@ try {
481484
$resultOfValidation = $false
482485
}
483486
elseif ($isBoolPluginEnabled -and (-not $isPluginSolutionPresent)) {
484-
Write-Host "Plugin solution in '$originalParentFolderPath' is invalid. Plugin solution should contain 'Connector', 'aiplugins' and 'aipluginoperations' folders."
485-
Write-Host "Validate the plugin solution has 'Connector', 'aiplugins' and 'aipluginoperations' components. If not so, please recreate the solution and export again."
487+
if ($isWorkflowsInPlugin) {
488+
$errorMessagePlugin = "Plugin solution should not contain 'Workflows' folder."
489+
} else {
490+
$errorMessagePlugin = "Plugin solution should contain 'Connector', 'aiplugins' and 'aipluginoperations' folders."
491+
}
492+
Write-Host "Plugin solution in '$originalParentFolderPath' is invalid."
493+
Write-Host "$errorMessagePlugin"
494+
Write-Host "Validate the plugin solution has only 'Connector', 'aiplugins' and 'aipluginoperations' components. If not so, please recreate the solution and export again."
486495
$resultOfValidation = $false
487496
}
488497
if ($resultOfValidation) {

0 commit comments

Comments
 (0)