Script Throws Error
The example script as shown does not execute. The error received is below:
`At line:15 char:1
+ workflow Test-Workflow
+ ~~~~~~~~~~~~~~~~~~~~~~
The function or workflow 'Test-Workflow' cannot be redefined.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : FunctionRedefinitionNotAllowed`
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 37f22b6b-0a8b-6621-400a-c35c61e106fd
- Version Independent ID: 87cc1dfa-5683-06f4-bb20-5e126e8fe2a7
- Content: about Foreach-Parallel - PowerShell
- Content Source: reference/5.1/PSWorkflow/About/about_Foreach-Parallel.md
- Product: powershell
- Technology: powershell-conceptual
- GitHub Login: @sdwheeler
- Microsoft Alias: sewhee
@aspnerd I am not able to reproduce the error you received. The error must be specific to your environment.
Also note that the example contains two different workflows. They happen to be use the same name. So if you are copying and pasting the code the Test-Workflow function is being defined and then redefined. The example is show two different ways to do parallel execution.
If they are two different examples, you should have them displayed as such. Not as one.
Jeff Taylor @.@.> https://blog.reviewmydb.com
From: Sean Wheeler @.> Sent: Friday, September 10, 2021 9:59 AM To: MicrosoftDocs/PowerShell-Docs @.> Cc: Jeff Taylor @.>; Mention @.> Subject: Re: [MicrosoftDocs/PowerShell-Docs] Script Throws Error (#8068)
@aspnerdhttps://github.com/aspnerd I am not able to reproduce the error you received. The error must be specific to your environment.
Also note that the example contains two different workflows. They happen to be use the same name. So if you are copying and pasting the code the Test-Workflow function is being defined and then redefined. The example is show two different ways to do parallel execution.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/MicrosoftDocs/PowerShell-Docs/issues/8068#issuecomment-916925755, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEF7FQ3PFPBGXHAAK4PTBYDUBIFKBANCNFSM5DYDXOCQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Hey @aspnerd, Sean has already split the example after your original comment. You should see the update later today.
Thanks for your feedback here and have a good one!
Great! Thanks!
Jeff Taylor @.@.> https://blog.reviewmydb.com
From: Chase Wilson @.> Sent: Friday, September 10, 2021 11:50 AM To: MicrosoftDocs/PowerShell-Docs @.> Cc: Jeff Taylor @.>; Mention @.> Subject: Re: [MicrosoftDocs/PowerShell-Docs] Script Throws Error (#8068)
Hey @aspnerdhttps://github.com/aspnerd, Sean has already split the example after your original comment. You should see the update later today.
Thanks for your feedback here and have a good one!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/MicrosoftDocs/PowerShell-Docs/issues/8068#issuecomment-917010889, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEF7FQ6WMZ2D2HC5DQZZ2I3UBISLFANCNFSM5DYDXOCQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.