Skip to content
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

Enable -NoRestart to work with Register-PSSessionConfiguration #23891

Merged
merged 4 commits into from
Jul 1, 2024

Conversation

SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Jun 4, 2024

PR Summary

Register-PSSessionConfiguration cmdlet inherits from a base class that exposes -NoServiceRestart, but the cmdlet (which really runs a script) doesn't do anything with this switch parameter.

Change is to pass that value along when using Set-PSSessionConfifguration from within the Register-PSSessionConfiguration script (and also -Force)

PR Context

Fix #23859

PR Checklist

@@ -139,7 +140,7 @@ public sealed class RegisterPSSessionConfigurationCommand : PSSessionConfigurati
## Replace the SDDL with any groups or restrictions defined in the PSSessionConfigurationFile
if($? -and $configTableSddl -and (-not $isSddlSpecified))
{{
$null = Set-PSSessionConfiguration -Name $pluginName -SecurityDescriptorSddl $configTableSddl -Force:$force
$null = Set-PSSessionConfiguration -Name $pluginName -SecurityDescriptorSddl $configTableSddl -NoServiceRestart:$NoRestart -Force:$force
Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes sense to write a verbose message if it is Windows PowerShell session?
"Windows PowerShell ignores the NoRestart switch."

Copy link
Member Author

Choose a reason for hiding this comment

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

Created doc issue for 5.1 to 7.4 MicrosoftDocs/PowerShell-Docs#11164

@iSazonov iSazonov added CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log PowerShell-Docs needed The PR was reviewed and a PowerShell Docs update is needed labels Jun 5, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Review - Needed The PR is being reviewed label Jun 12, 2024
@daxian-dbw daxian-dbw removed the Review - Needed The PR is being reviewed label Jul 1, 2024
@daxian-dbw daxian-dbw merged commit 908c325 into PowerShell:master Jul 1, 2024
37 checks passed
Copy link
Contributor

microsoft-github-policy-service bot commented Jul 1, 2024

📣 Hey @SteveL-MSFT, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log PowerShell-Docs needed The PR was reviewed and a PowerShell Docs update is needed
Projects
None yet
3 participants