diff --git a/src/Microsoft.WSMan.Management/ConfigProvider.cs b/src/Microsoft.WSMan.Management/ConfigProvider.cs index d933a806c0..95d1e1679f 100644 --- a/src/Microsoft.WSMan.Management/ConfigProvider.cs +++ b/src/Microsoft.WSMan.Management/ConfigProvider.cs @@ -43,12 +43,12 @@ namespace Microsoft.WSMan.Management /// /// Object contains the cache of the enumerate results for the cmdlet to execute. /// - private Dictionary enumerateMapping = new Dictionary(); + private readonly Dictionary enumerateMapping = new Dictionary(); /// /// Mapping of ResourceURI with the XML returned by the Get call. /// - private Dictionary getMapping = new Dictionary(); + private readonly Dictionary getMapping = new Dictionary(); #region ICmdletProviderSupportsHelp Members diff --git a/src/Microsoft.WSMan.Management/CurrentConfigurations.cs b/src/Microsoft.WSMan.Management/CurrentConfigurations.cs index 01ba71f68a..783bfe1ef0 100644 --- a/src/Microsoft.WSMan.Management/CurrentConfigurations.cs +++ b/src/Microsoft.WSMan.Management/CurrentConfigurations.cs @@ -21,7 +21,7 @@ namespace Microsoft.WSMan.Management /// /// This holds the current configurations XML. /// - private XmlDocument rootDocument; + private readonly XmlDocument rootDocument; /// /// Holds the reference to the current document element. @@ -36,7 +36,7 @@ namespace Microsoft.WSMan.Management /// /// Session of the WsMan sserver. /// - private IWSManSession serverSession; + private readonly IWSManSession serverSession; /// /// Gets the server session associated with the configuration. diff --git a/src/Microsoft.WSMan.Management/InvokeWSManAction.cs b/src/Microsoft.WSMan.Management/InvokeWSManAction.cs index 1472a26f01..9420dd4a77 100644 --- a/src/Microsoft.WSMan.Management/InvokeWSManAction.cs +++ b/src/Microsoft.WSMan.Management/InvokeWSManAction.cs @@ -244,7 +244,7 @@ namespace Microsoft.WSMan.Management private Uri resourceuri; private WSManHelper helper; - private IWSManEx m_wsmanObject = (IWSManEx)new WSManClass(); + private readonly IWSManEx m_wsmanObject = (IWSManEx)new WSManClass(); private IWSManSession m_session = null; private string connectionStr = string.Empty; diff --git a/src/Microsoft.WSMan.Management/WSManInstance.cs b/src/Microsoft.WSMan.Management/WSManInstance.cs index fa96cacf78..21ae0d1f0f 100644 --- a/src/Microsoft.WSMan.Management/WSManInstance.cs +++ b/src/Microsoft.WSMan.Management/WSManInstance.cs @@ -1465,7 +1465,7 @@ namespace Microsoft.WSMan.Management private Hashtable valueset; private WSManHelper helper; - private IWSManEx m_wsmanObject = (IWSManEx)new WSManClass(); + private readonly IWSManEx m_wsmanObject = (IWSManEx)new WSManClass(); private IWSManSession m_session = null; private string connectionStr = string.Empty; diff --git a/src/Microsoft.WSMan.Management/WsManHelper.cs b/src/Microsoft.WSMan.Management/WsManHelper.cs index f09ba2bb23..80010a0f5c 100644 --- a/src/Microsoft.WSMan.Management/WsManHelper.cs +++ b/src/Microsoft.WSMan.Management/WsManHelper.cs @@ -78,13 +78,13 @@ namespace Microsoft.WSMan.Management // string for operation internal string WSManOp = null; - private PSCmdlet cmdletname; - private NavigationCmdletProvider _provider; + private readonly PSCmdlet cmdletname; + private readonly NavigationCmdletProvider _provider; private FileStream _fs; private StreamReader _sr; - private static ResourceManager _resourceMgr = new ResourceManager("Microsoft.WSMan.Management.resources.WsManResources", typeof(WSManHelper).GetTypeInfo().Assembly); + private static readonly ResourceManager _resourceMgr = new ResourceManager("Microsoft.WSMan.Management.resources.WsManResources", typeof(WSManHelper).GetTypeInfo().Assembly); // // @@ -1135,6 +1135,6 @@ namespace Microsoft.WSMan.Management /// /// - private static Dictionary ResourceValueCache = new Dictionary(); + private static readonly Dictionary ResourceValueCache = new Dictionary(); } }