-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PSDesiredStateConfiguration exporting internal functions #7209
Labels
Area-DSC
Desired State Configuration issues
Issue-Bug
Issue has been identified as a bug in the product
Resolution-Fixed
The issue is fixed.
Comments
joeyaiello
added
Issue-Bug
Issue has been identified as a bug in the product
Area-DSC
Desired State Configuration issues
labels
Jun 29, 2018
HowardWolosky
added a commit
to HowardWolosky/PowerShellForGitHub
that referenced
this issue
May 26, 2020
Somehow a number of PSScriptAnalyzer issues snuck in. This fixes them. The main PSScriptAnalyzer issues needing to be fixed were: * `PSReviewUnusedParameter` - This one came up a lot due to our heavy usage of `Resolve-RepositoryElements` and `Resolve-ParameterWithDefaultConfigurationValue` which both end up referencing their parameters by grabbing them off the stack. That means that `NoStatus` and `Uri` are frequently never directly referenced. So, exceptions were added. There were two cases (in GitHubAnalytics) where there was a false positive due to PowerShell/PSScriptAnalyzer#1472 * `PSUseProcessBlockForPipelineCommand` - We had a number of functions that took pipeline input, but didn't actuall use the `process` block. This actually caught a bug with `Group-GitHubIssue` and `Group-GitHubPullRequest`. Added correct `process` block usage for most of the functions, but removed pipeline support for those where it didn't actually make sense anymore. * `PSUseDeclaredVarsMoreThanAssignments` - These are false positives in the Pester tests due to the usage of `BeforeAll`. There wasn't an obvious way to use `SuppressMessageAttribute` in the Pester test, so I used a hacky workaround to "use" the variable in the `BeforeAll` block. I could have added the suppression to the top of the file, but I still want to catch real issues in those files later. * `PSAvoidOverwritingBuiltInCmdlets` - It turns out that there's a bug with PSDesiredStateConfiguration in PS Core 6.1.0 where it was exporting internal functions. This was thus a false-postive flag for Write-Log. See PowerShell/PowerShell#7209 for more info. Also, it turns out that `Group-GitHubPullRequest` hadn't actually been exported, so I fixed that too.
HowardWolosky
added a commit
to microsoft/PowerShellForGitHub
that referenced
this issue
May 26, 2020
Somehow a number of PSScriptAnalyzer issues snuck in. This fixes them. The main PSScriptAnalyzer issues needing to be fixed were: * `PSReviewUnusedParameter` - This one came up a lot due to our heavy usage of `Resolve-RepositoryElements` and `Resolve-ParameterWithDefaultConfigurationValue` which both end up referencing their parameters by grabbing them off the stack. That means that `NoStatus` and `Uri` are frequently never directly referenced. So, exceptions were added. There were two cases (in GitHubAnalytics) where there was a false positive due to PowerShell/PSScriptAnalyzer#1472 * `PSUseProcessBlockForPipelineCommand` - We had a number of functions that took pipeline input, but didn't actuall use the `process` block. This actually caught a bug with `Group-GitHubIssue` and `Group-GitHubPullRequest`. Added correct `process` block usage for most of the functions, but removed pipeline support for those where it didn't actually make sense anymore. * `PSUseDeclaredVarsMoreThanAssignments` - These are false positives in the Pester tests due to the usage of `BeforeAll`. There wasn't an obvious way to use `SuppressMessageAttribute` in the Pester test, so I used a hacky workaround to "use" the variable in the `BeforeAll` block. I could have added the suppression to the top of the file, but I still want to catch real issues in those files later. * `PSAvoidOverwritingBuiltInCmdlets` - It turns out that there's a bug with PSDesiredStateConfiguration in PS Core 6.1.0 where it was exporting internal functions. This was thus a false-postive flag for Write-Log. See PowerShell/PowerShell#7209 for more info. Also, it turns out that `Group-GitHubPullRequest` hadn't actually been exported, so I fixed that too.
This has been fixed for a while |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area-DSC
Desired State Configuration issues
Issue-Bug
Issue has been identified as a bug in the product
Resolution-Fixed
The issue is fixed.
The
PSDesiredStateConfiguration
modules shipping in PowerShell Core exports every function defined in the module instead of the smaller set that gets exported on Windows PowerShell.Even if this owned by the DSC team, we should track it here until it's fixed in our shipping product.
Steps to reproduce
Expected behavior
Actual behavior
Environment data
The text was updated successfully, but these errors were encountered: