diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/InvokeRestMethodCommand.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/InvokeRestMethodCommand.Common.cs index a6a2a6290b0..a2418efbb86 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/InvokeRestMethodCommand.Common.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/InvokeRestMethodCommand.Common.cs @@ -32,9 +32,9 @@ public class InvokeRestMethodCommand : WebRequestPSCmdlet [Parameter(ParameterSetName = "StandardMethodNoProxy")] public override WebRequestMethod Method { - get { return base.Method; } + get => base.Method; - set { base.Method = value; } + set => base.Method = value; } /// @@ -46,9 +46,9 @@ public override WebRequestMethod Method [ValidateNotNullOrEmpty] public override string CustomMethod { - get { return base.CustomMethod; } + get => base.CustomMethod; - set { base.CustomMethod = value; } + set => base.CustomMethod = value; } /// @@ -58,9 +58,9 @@ public override string CustomMethod [Alias("FL")] public SwitchParameter FollowRelLink { - get { return base._followRelLink; } + get => base._followRelLink; - set { base._followRelLink = value; } + set => base._followRelLink = value; } /// @@ -71,9 +71,9 @@ public SwitchParameter FollowRelLink [ValidateRange(1, int.MaxValue)] public int MaximumFollowRelLink { - get { return base._maximumFollowRelLink; } + get => base._maximumFollowRelLink; - set { base._maximumFollowRelLink = value; } + set => base._maximumFollowRelLink = value; } /// @@ -401,18 +401,15 @@ public override void Flush() _streamBuffer.SetLength(0); } - public override long Length - { - get { return _length; } - } + public override long Length => _length; private long _length; public override long Position { - get { return _streamBuffer.Position; } + get => _streamBuffer.Position; - set { _streamBuffer.Position = value; } + set => _streamBuffer.Position = value; } public override int Read(byte[] buffer, int offset, int count) @@ -420,8 +417,7 @@ public override int Read(byte[] buffer, int offset, int count) long previousPosition = Position; bool consumedStream = false; int totalCount = count; - while ((!consumedStream) && - ((Position + totalCount) > _streamBuffer.Length)) + while (!consumedStream && (Position + totalCount) > _streamBuffer.Length) { // If we don't have enough data to fill this from memory, cache more. // We try to read 4096 bytes from base stream every time, so at most we