Skip to content

Don't request write permissions for RemotePowerShellConfig.txt - #102

Open
Tadas Medišauskas (Tadas) wants to merge 1 commit into
PowerShell:masterfrom
Tadas:master
Open

Tadas Medišauskas (Tadas) wants to merge 1 commit into
PowerShell:masterfrom
Tadas:master

Conversation

@Tadas

@Tadas Tadas Medišauskas (Tadas) commented Apr 24, 2025 •

Copy link
Copy Markdown

PR Summary

Change remoting config file (%windir%\System32\PowerShell\7.5.0\RemotePowerShellConfig.txt) reader to use an input stream instead of an input/output stream. This means that write access is no longer needed in this system directory.
image

PR Context

This should help with issues:
MicrosoftDocs/PowerShell-Docs#11682
PowerShell/PowerShell#18741
PowerShell/PowerShell#20180
PowerShell/PowerShell#14274
PowerShell/PowerShell#17367

Tip

For completeness sake, I will mention that if you change (Get-PSSessionConfiguration -Name <session_config_name>).Filename to point at the dll that is present in PowerShell's install location (e.g. "C:\Program Files\PowerShell\7\pwrshplugin.dll") it should work without write permissions, with the added benefit of always having this file auto-updated when a new version of PowerShell is installed.

Excellent write up in https://awakecoding.com/posts/enable-powershell-winrm-remoting-in-powershell-7/ shows the command to do that:

Set-Item -Path "WSMan:\localhost\Plugin\PowerShell.7\Filename" -Value $WSManPluginPath
@soroshsabz

Copy link
Copy Markdown

ITNOA

Any update?

thanks

@Tadas

Copy link
Copy Markdown
Author

I guess this needs a review to progress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants