René's URL Explorer Experiment


Title: Error in Azure Pipeline when Get-ProjectName returns multiple items · Issue #134 · PowerShellOrg/BuildHelpers · GitHub

Open Graph Title: Error in Azure Pipeline when Get-ProjectName returns multiple items · Issue #134 · PowerShellOrg/BuildHelpers

X Title: Error in Azure Pipeline when Get-ProjectName returns multiple items · Issue #134 · PowerShellOrg/BuildHelpers

Description: We're getting an error "Cannot process argument transformation on parameter 'Value'. Cannot convert value to type System.String." when Set-BuildEnvironment calls Set-AzurePipelinesVariable with the value of ProjectName which is an array....

Open Graph Description: We're getting an error "Cannot process argument transformation on parameter 'Value'. Cannot convert value to type System.String." when Set-BuildEnvironment calls Set-AzurePipelinesVariable with the...

X Description: We're getting an error "Cannot process argument transformation on parameter 'Value'. Cannot convert value to type System.String." when Set-BuildEnvironment calls Set-AzurePipe...

Opengraph URL: https://github.com/PowerShellOrg/BuildHelpers/issues/134

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error in Azure Pipeline when Get-ProjectName returns multiple items","articleBody":"We're getting an error \"Cannot process argument transformation on parameter 'Value'. Cannot convert value to type System.String.\" when `Set-BuildEnvironment` calls `Set-AzurePipelinesVariable` with the value of ProjectName which is an array.\r\n\r\nQuick fix: since `Set-AzurePipelinesVariable` requires a string, you should cast the value explicitly:\r\n\r\nhttps://github.com/RamblingCookieMonster/BuildHelpers/blob/5b712c4777f258b987672658af71488caa5f9ccc/BuildHelpers/Public/Set-BuildEnvironment.ps1#L126\r\n\r\nNeeds to be:\r\n\r\n```PowerShell\r\nSet-AzurePipelinesVariable -Name $prefixedVar -Value \"$($BuildHelpersVariables[$VarName])\"\r\n```\r\n\r\nor:\r\n\r\n```PowerShell\r\nSet-AzurePipelinesVariable -Name $prefixedVar -Value ([string]$BuildHelpersVariables[$VarName])\r\n```\r\n\r\n----\r\n\r\nRoot cause: we've been using BuildHelpers for a long time with no problems -- even on non-module projects. Today we upgraded from 2.0.3 to 2.0.16 and this new discovery case in `Get-ProjectName` caused the problem.\r\n```PowerShell\r\n        #PSD1 in root of project but name doesn't match\r\n        #very ick or just an icky time in Azure Pipelines\r\n        elseif ( $PSDs = Get-ChildItem -Path $Path \"*.psd1\" )\r\n        {\r\n            if ($PSDs.count -gt 1) {\r\n                Write-Warning \"Found more than one project manifest in the root folder\"\r\n            }\r\n            $result = $PSDs.BaseName\r\n        }\r\n```\r\n\r\nUntil now, we've been falling through to the default `$result = Split-Path $Path -Leaf` value, which was fine, because we're in a multi-checkout project, so our folder is named with the project name. \r\n\r\nNow, our `ScriptAnalyzerSettings.psd1` and our `RequiredModules.psd1` and a couple of other similar configuration files are being treated as the project name(s) -- resulting in multiple items being returned, **all** of which are *wrong* -- and this error when the call to Set-AzurePipelinesVariable assumes a string result.\r\n\r\nMy recommendation is to fix the call to Set-AzurePipelinesVariable as I suggested above, but also to consider that if you found _multiple results_ from looking at psd1 files, they are **definitely not the right value** and you should keep looking (and fall through to the folder name).\r\n\r\n\r\n\r\n```log\r\n ErrorRecord       : \r\n        Exception             : \r\n            Type    : System.Management.Automation.ParentContainsErrorRecordException\r\n            Message : Cannot process argument transformation on parameter 'Value'. Cannot convert value to type System.String.\r\n            HResult : -2146233087\r\n        CategoryInfo          : InvalidData: (:) [Set-AzurePipelinesVariable], ParentContainsErrorRecordException\r\n        FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-AzurePipelinesVariable\r\n        InvocationInfo        : \r\n            MyCommand        : Set-AzurePipelinesVariable\r\n            ScriptLineNumber : 126\r\n            OffsetInLine     : 70\r\n            HistoryId        : 1\r\n            ScriptName       : C:\\Program Files\\WindowsPowerShell\\Modules\\BuildHelpers\\2.0.16\\Public\\Set-BuildEnvironment.ps1\r\n            Line             :                 Set-AzurePipelinesVariable -Name $prefixedVar -Value $BuildHelpersVariables[$VarName]\r\n            PositionMessage  : At C:\\Program Files\\WindowsPowerShell\\Modules\\BuildHelpers\\2.0.16\\Public\\Set-BuildEnvironment.ps1:126 char:70\r\n                               + … esVariable -Name $prefixedVar -Value $BuildHelpersVariables[$VarName]\r\n                               +                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n            PSScriptRoot     : C:\\Program Files\\WindowsPowerShell\\Modules\\BuildHelpers\\2.0.16\\Public\r\n            PSCommandPath    : C:\\Program Files\\WindowsPowerShell\\Modules\\BuildHelpers\\2.0.16\\Public\\Set-BuildEnvironment.ps1\r\n            CommandOrigin    : Internal\r\n        ScriptStackTrace      : at Set-BuildEnvironment, C:\\Program Files\\WindowsPowerShell\\Modules\\BuildHelpers\\2.0.16\\Public\\Set-BuildEnvironment.ps1: line 126\r\n                                at \u003cScriptBlock>, D:\\Agents\\Agent1\\_work\\17\\s\\InvokeBuildTasks\\Initialize.ps1: line 4\r\n                                at \u003cScriptBlock>, D:\\Agents\\Agent1\\_work\\17\\s\\SharedInfrastructureModules\\Bicep.build.ps1: line 22\r\n                                at \u003cScriptBlock>\u003cEnd>, C:\\Program Files\\WindowsPowerShell\\Modules\\InvokeBuild\\5.8.0\\Invoke-Build.ps1: line 655\r\n                                at \u003cScriptBlock>, D:\\Agents\\Agent1\\_work\\17\\s\\SharedInfrastructureModules\\init.ps1: line 24\r\n                                at \u003cScriptBlock>, D:\\Agents\\Agent1\\_work\\_temp\\59cf28f5-e8a3-41af-b6d3-6b2866b97e99.ps1: line 3\r\n                                at \u003cScriptBlock>, \u003cNo file>: line 1\r\n\r\n```","author":{"url":"https://github.com/Jaykul","@type":"Person","name":"Jaykul"},"datePublished":"2022-09-14T14:26:11Z","url":"https://github.com/PowerShellOrg/BuildHelpers/issues/134"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:2c148aea-fd84-fe88-b7bf-6172697261ea
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDE72:2CE323:D60E74:1251B17:6AFD384F
html-safe-noncea7075adcfa0aa326a9812084b7b9bcaa9dbc4aade76e2788ba558744310a9519
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTcyOjJDRTMyMzpENjBFNzQ6MTI1MUIxNzo2QUZEMzg0RiIsInZpc2l0b3JfaWQiOiIyOTkwODYxMzU5NTI2MDAwNzE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacccbe5886c74e5b44aac83f14a4505adb59a1a8893fca0c78fc1d5ae7cb405da2
hovercard-subject-tagissue:1373081925
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShellOrg/BuildHelpers/134/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f48c2bda250d3064231c470dd807bcac8e956838210ae9476b069dd571d5a2d2/PowerShellOrg/BuildHelpers/issues/134
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f48c2bda250d3064231c470dd807bcac8e956838210ae9476b069dd571d5a2d2/PowerShellOrg/BuildHelpers/issues/134
og:image:altWe're getting an error "Cannot process argument transformation on parameter 'Value'. Cannot convert value to type System.String." when Set-BuildEnvironment calls Set-AzurePipelinesVariable with the...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJaykul
hostnamegithub.com
expected-hostnamegithub.com
None065128366c233a9d57ff68ab6c96e25b99dd1b0ab70d23b70873d3dd6b5e4f19
turbo-cache-controlno-preview
go-importgithub.com/PowerShellOrg/BuildHelpers git https://github.com/PowerShellOrg/BuildHelpers.git
octolytics-dimension-user_id4895314
octolytics-dimension-user_loginPowerShellOrg
octolytics-dimension-repository_id59748913
octolytics-dimension-repository_nwoPowerShellOrg/BuildHelpers
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id59748913
octolytics-dimension-repository_network_root_nwoPowerShellOrg/BuildHelpers
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release941021edf0c2ec58298f4a2c8f27ae507d129c92
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShellOrg/BuildHelpers/issues/134#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShellOrg%2FBuildHelpers%2Fissues%2F134
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShellOrg%2FBuildHelpers%2Fissues%2F134
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShellOrg%2FBuildHelpers
Reloadhttps://github.com/PowerShellOrg/BuildHelpers/issues/134
Reloadhttps://github.com/PowerShellOrg/BuildHelpers/issues/134
Reloadhttps://github.com/PowerShellOrg/BuildHelpers/issues/134
PowerShellOrghttps://github.com/PowerShellOrg
BuildHelpershttps://github.com/PowerShellOrg/BuildHelpers
Codehttps://github.com/PowerShellOrg/BuildHelpers
Issues37 (37)https://github.com/PowerShellOrg/BuildHelpers/issues
Pull requests11 (11)https://github.com/PowerShellOrg/BuildHelpers/pulls
Actionshttps://github.com/PowerShellOrg/BuildHelpers/actions
Projectshttps://github.com/PowerShellOrg/BuildHelpers/projects
Security and qualityhttps://github.com/PowerShellOrg/BuildHelpers/security
Insightshttps://github.com/PowerShellOrg/BuildHelpers/insights
https://github.com/PowerShellOrg/BuildHelpers
New issuehttps://github.com/login?return_to=https://github.com/PowerShellOrg/BuildHelpers/issues/134
New issuehttps://github.com/login?return_to=https://github.com/PowerShellOrg/BuildHelpers/issues/134
#135https://github.com/PowerShellOrg/BuildHelpers/pull/135
Error in Azure Pipeline when Get-ProjectName returns multiple itemshttps://github.com/PowerShellOrg/BuildHelpers/issues/134#top
#135https://github.com/PowerShellOrg/BuildHelpers/pull/135
https://github.com/Jaykul
Jaykulhttps://github.com/Jaykul
on Sep 14, 2022https://github.com/PowerShellOrg/BuildHelpers/issues/134#issue-1373081925
https://github.com/RamblingCookieMonster/BuildHelpers/blob/5b712c4777f258b987672658af71488caa5f9ccc/BuildHelpers/Public/Set-BuildEnvironment.ps1#L126https://github.com/RamblingCookieMonster/BuildHelpers/blob/5b712c4777f258b987672658af71488caa5f9ccc/BuildHelpers/Public/Set-BuildEnvironment.ps1#L126
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShellOrg/BuildHelpers/issues/134
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShellOrg/BuildHelpers/issues/134
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.