How do I go about getting only one of the values returned from the PS command below?
PS C:\Users\vagrant> winrm get winrm/config/winrs
Winrs
AllowRemoteShellAccess = true
IdleTimeout = 7200000
MaxConcurrentUsers = 10
MaxShellRunTime = 2147483647
MaxProcessesPerShell = 25
MaxMemoryPerShellMB = 300
MaxShellsPerUser = 30
Specifically, I'm trying to to get only the value of MaxMemoryPerShellMB
. Ultimately I need to compare that value to another value so I can be sure to set it correctly if needed.
You can use WS-Management provider to get or set WS-Management configuration options:
You can say, that them both refer mostly to the same thing:
All the options of
winrm get winrm/config
available underWSMan:\localhost\
PowerShell path. Some of them can use different naming, likeShell
instead ofwinrs
(Window Remote Shell), but in most cases names match. You can explore available configuration options by standard PowerShell commands, likedir WSMan:\localhost\
.