Set-WSManInstance fails in PowerShell 7

Viewed 19

I have PowerShell 5 and PowerShell 7 installed on my computer. I open a PowerShell window as Administrator for each version.

PowerShell 5

PS C:\> Get-WSManInstance -ResourceURI winrm/config

cfg                 : http://schemas.microsoft.com/wbem/wsman/1/config
lang                : en-US
MaxEnvelopeSizekb   : 500
MaxTimeoutms        : 60000
MaxBatchItems       : 32000
MaxProviderRequests : 4294967295
Client              : Client
Service             : Service
Winrs               : Winrs

PS C:\> Set-WSManInstance -ResourceURI winrm/config -ValueSet @{MaxEnvelopeSizekb="200"}

cfg                 : http://schemas.microsoft.com/wbem/wsman/1/config
lang                : en-US
MaxEnvelopeSizekb   : 200
MaxTimeoutms        : 60000
MaxBatchItems       : 32000
MaxProviderRequests : 4294967295
Client              : Client
Service             : Service
Winrs               : Winrs

PowerShell 7 (7.2.5)

PS C:\> Get-WSManInstance -ResourceURI winrm/config

cfg                 : http://schemas.microsoft.com/wbem/wsman/1/config
lang                : en-US
MaxEnvelopeSizekb   : 200
MaxTimeoutms        : 60000
MaxBatchItems       : 32000
MaxProviderRequests : 4294967295
Client              : Client
Service             : Service
Winrs               : Winrs


PS C:\> Set-WSManInstance -ResourceURI winrm/config -ValueSet @{MaxEnvelopeSizekb="200"}
Set-WSManInstance: The WS-Management service cannot process the request. The resource URI is missing or it has an incorrect format. Check the documentation or use the following command for information on how to construct a resource URI: "winrm help uris".
PS C:\>
  • The command I am using above is taken from the cmdlet Example 2 in the Powershell documentation.

Any ideas to why this is different in PowerShell 7?

0 Answers
Related