-
Notifications
You must be signed in to change notification settings - Fork 393
PSShouldProcess hangs #1287
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
Comments
I'm seeing this same issue on my local machine but not when I run a similar script via Azure DevOps. |
|
Apologies, I was going to come back to this and dig deeper than I had above. When I say hang I mean it stops, cannot be cancelled (without closing the console), and never completes (with the caveat that the longest I've waited is 2 hours). This is the module I'm executing script analyzer against: https://github.com/indented-automation/Indented.Nexus Normally I run it against the merged version of the module. A single psm1 file based on the content of that repo. Just trying to see if I can isolate it to a single piece of code. I thought I had, script analyzer seems to reliably hang when run against this file in isolation: But I bumped that out of the psm1 and it's still hanging. Give me a few minutes to see if I can isolate what in the psm1 it doesn't like. |
Okay, I've trimmed down the code a lot. This snippet reproduces the problem for me: Invoke-ScriptAnalyzer -Verbose -ScriptDefinition @'
function SomeCommand { }
[DscResource()]
class SomeClass {
[String] $Name = 'Value'
[Void] Set() {
$source = Get-PackageSource -Name $this.Name
}
[Boolean] Test() {
# $source = Get-PackageSource -Name $this.Name
$something = SomeCommand -Name $this.Name
}
}
'@ There are some combinations with this one.
If I add the module name in front of the package management commands (e.g. I'll wipe all other copies of package management off this computer a bit later and repeat this experiment. |
Hmm, I cannot reproduce this with PS 6.2.1 or 5.1 on Windows 10 1903 with the released version of 1.18.1 unfortunately. |
@indented-automation, @ChrisLGardner if you could get a proc dump ( |
Closing due to inactivity |
@indented-automation, @ChrisLGardner Let us know if this is still happening and needs re-opening but we'd need more info then |
Apologies. It is, but I'm putting it all down to oddities in
PackageManagement / PowerShellGet. I've shuffled those out simply because
wherever they go they seem to cause problems.
…On Wed, 17 Jun 2020 at 09:36, Christoph Bergmeister [MVP] < ***@***.***> wrote:
@indented-automation <https://github.com/indented-automation>,
@ChrisLGardner <https://github.com/ChrisLGardner> Let us know if this is
still happening and needs re-opening but we'd need more info then
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1287 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADB3UDS2YB7K7DT6J5DMTFLRXB6B3ANCNFSM4ICGELZA>
.
|
@indented-automation Starting with PSSA 1.18.2 (which was released after you opened this issue), we fixed a problem that caused PSSA to hang due to PackageManagement / PowerShellGet in #1316 |
Nope, I am not. I was on 1.18.3. I'll upgrade, thank you!
…On Wed, 17 Jun 2020 at 10:27, Christoph Bergmeister [MVP] < ***@***.***> wrote:
@indented-automation <https://github.com/indented-automation> Starting
with PSSA 1.18.2 (which was released after you opened this issue), we fixed
a problem that caused PSSA to hang due to PackageManagement / PowerShellGet
in #1316 <#1316>
Can you confirm you are using the latest version (1.19.0)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1287 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADB3UDW6Z5H3IZLDFFMPJ4TRXCD7FANCNFSM4ICGELZA>
.
|
Ok, please let us know the outcome. I am going to re-open the issue in the meantime but still leave the |
Closing due to inactivity |
Steps to reproduce
This fault is intermittent and causes me most trouble when it occurs on AppVeyor.
Expected behavior
Script analyzer completes with no errors, there are none in the code I'm testing.
Actual behavior
Script analyzer hangs before or during the PSShouldProcess rule.
Script Analyzer cannot be terminated using Control and C.
Environment data
Tested under PowerShell 5.1 and 6.2 as shown below.
And:
The text was updated successfully, but these errors were encountered: