-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
Enable -NoRestart
to work with Register-PSSessionConfiguration
#23891
Conversation
@@ -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 |
There was a problem hiding this comment.
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."
There was a problem hiding this comment.
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
src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs
Outdated
Show resolved
Hide resolved
…omShellCommands.cs
…omShellCommands.cs
…omShellCommands.cs
📣 Hey @SteveL-MSFT, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
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 theRegister-PSSessionConfiguration
script (and also-Force
)PR Context
Fix #23859
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.- [ ] Issue filed: WinPS5.1 Register-PSSessionConfiguration ignores
-NoServiceRestart
MicrosoftDocs/PowerShell-Docs#11164(which runs in a different PS Host).