Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Open
Tadas wants to merge 1 commit into
PowerShell:masterPowerShell/PowerShell-Native:masterfrom
Tadas:masterTadas/PowerShell-Native:masterCopy head branch name to clipboard
Open

Don't request write permissions for RemotePowerShellConfig.txt#102
Tadas wants to merge 1 commit into
PowerShell:masterPowerShell/PowerShell-Native:masterfrom
Tadas:masterTadas/PowerShell-Native:masterCopy head branch name to clipboard

Conversation

@Tadas
Copy link
Copy Markdown

@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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.