Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Fix issue #30 #46

Closed
wants to merge 7 commits into from
Closed

Fix issue #30 #46

wants to merge 7 commits into from

Conversation

jnury
Copy link
Contributor

@jnury jnury commented May 10, 2018

Hello,

This is my fix proposal for issue #30.

Before registering the PSSessionConfiguration, we save the list of services running in the same process as WinRM + services depending from them.

We let Register-PSSessionConfiguration command 10 seconds to complete. If it not complete in 10 seconds and the WinRM service is in the state 'Stopping', we kill the process hosting WinRm service and then restart all services impacted.


This change is Reviewable

@rpsqrd
Copy link
Collaborator

rpsqrd commented May 14, 2018

Thanks Julien -- I'll take a closer look this week and get this merged in. How would we suggest people opt out of this feature if they don't want the risk of killing the process? Set the timeout to [int]::MaxValue or null?

@jnury
Copy link
Contributor Author

jnury commented May 14, 2018 via email

@jnury
Copy link
Contributor Author

jnury commented May 20, 2018

Disabling WinRM workaround (process killing) is implemented: when HungRegistrationTimeout is set to 0, no process is killed.

{
# Temporary disabling Verbose as xxx-PSSessionConfiguration methods verbose messages are useless for DSC debugging
$VerbosePreferenceBackup = $Global:VerbosePreference
$Global:VerbosePreference = 'SilentlyContinue'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be changed to the script scope?

{
# Temporary disabling Verbose as xxx-PSSessionConfiguration methods verbose messages are useless for DSC debugging
$VerbosePreferenceBackup = $Global:VerbosePreference
$Global:VerbosePreference = 'SilentlyContinue'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same scope issue


if ($Path)
{
$registerString = "`$null = Register-PSSessionConfiguration -Name '$Name' -Path '$Path' -Force -ErrorAction 'Stop' -WarningAction 'SilentlyContinue'"
Copy link
Member

@TravisEz13 TravisEz13 Jul 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a static script block with parameters and the argument list to Start-job?

Copy link
Member

@TravisEz13 TravisEz13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

@jnury jnury closed this by deleting the head repository Oct 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants