cloudyspells / PSRule.Rules.AzureDevOps

PSRule Module for Azure DevOps. Audit your Azure DevOps project configuration for best practice adoption in minutes.
MIT License
23 stars 2 forks source link

$OutputPath in case if Azure DevOps service connection contains backslash \ #106

Closed bbz94 closed 9 months ago

bbz94 commented 9 months ago

Need to add fix in code in case if Azure DevOps service connection contains backslash /:

      "name": "CI/CD template Repo Connection",
      "description": ""
    }
  ],
  "ObjectType": "Azure.DevOps.ServiceConnection",

Link to line in code: https://github.com/cloudyspells/PSRule.Rules.AzureDevOps/blob/e609897620d10de08b88a8be416994066142ce23/src/PSRule.Rules.AzureDevOps/Functions/DevOps.ServiceConnections.ps1#L156

Error message from Azure DevOps pipeline:

Out-File: /home/vsts/.local/share/powershell/Modules/PSRule.Rules.AzureDevOps/0.4.3/Functions/DevOps.ServiceConnections.ps1:156
Line |
 156 |  … Depth 100 | Out-File "$OutputPath/$($serviceConnection.name).ado.sc.j …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Could not find a part of the path '/home/vsts/work/_temp/CI/CD template
     | Repo Connection.ado.sc.json'.
wouter-van-den-meulenhof commented 9 months ago

Fixed your issue. Thanks for reporting it!