Skip to content

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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tadas
Copy link

@Tadas Tadas commented Apr 24, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant