Skip to content

Commit 4f3d0a6

Browse files
authored
1 parent fa8b94e commit 4f3d0a6

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

src/Microsoft.WSMan.Management/ConfigProvider.cs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ protected override void SetItem(string path, object value)
10331033
pluginConfiguration.UpdateOneConfiguration(
10341034
".",
10351035
WSManStringLiterals.ConfigRunAsPasswordName,
1036-
this.GetStringFromSecureString(runAsCredentials.Password));
1036+
GetStringFromSecureString(runAsCredentials.Password));
10371037
}
10381038
}
10391039

@@ -1050,7 +1050,7 @@ protected override void SetItem(string path, object value)
10501050
AssertError(helper.GetResourceMsgFromResourcetext("SetItemOnRunAsPasswordNoRunAsUser"), false);
10511051
}
10521052

1053-
value = this.GetStringFromSecureString(value);
1053+
value = GetStringFromSecureString(value);
10541054
}
10551055

10561056
pluginConfiguration.UpdateOneConfiguration(".", ChildName, value.ToString());
@@ -2290,7 +2290,7 @@ private void NewItemPluginOrPluginChild(object sessionobj, string path, string h
22902290
/// <param name="WSManElementObjectType"></param>
22912291
/// <param name="input"></param>
22922292
/// <returns></returns>
2293-
private PSObject GetItemPSObjectWithTypeName(string Name, string TypeNameOfElement, object Value, string[] keys, string ExtendedTypeName, WsManElementObjectTypes WSManElementObjectType, PSObject input = null)
2293+
private static PSObject GetItemPSObjectWithTypeName(string Name, string TypeNameOfElement, object Value, string[] keys, string ExtendedTypeName, WsManElementObjectTypes WSManElementObjectType, PSObject input = null)
22942294
{
22952295
PSObject mshObject = null;
22962296
if (WSManElementObjectType.Equals(WsManElementObjectTypes.WSManConfigElement))
@@ -2410,7 +2410,7 @@ private void SetItemListenerOrClientCertificate(object sessionObj, string Resour
24102410
/// <param name="value"></param>
24112411
/// <param name="host"></param>
24122412
/// <returns></returns>
2413-
private string GetInputStringForCreate(string ResourceURI, Hashtable value, string host)
2413+
private static string GetInputStringForCreate(string ResourceURI, Hashtable value, string host)
24142414
{
24152415
string putstr = string.Empty;
24162416
string nilns = string.Empty;
@@ -2523,7 +2523,7 @@ private string GetHostName(string path)
25232523
return sHostname;
25242524
}
25252525

2526-
private string GetRootNodeName(string ResourceURI)
2526+
private static string GetRootNodeName(string ResourceURI)
25272527
{
25282528
string tempuri = string.Empty;
25292529
if (ResourceURI.Contains('?'))
@@ -2542,7 +2542,7 @@ private string GetRootNodeName(string ResourceURI)
25422542
return tempuri;
25432543
}
25442544

2545-
private string EscapeValuesForXML(string value)
2545+
private static string EscapeValuesForXML(string value)
25462546
{
25472547
StringBuilder esc_str = new StringBuilder();
25482548
for (int i = 0; i <= value.Length - 1; i++)
@@ -2585,7 +2585,7 @@ private string EscapeValuesForXML(string value)
25852585
return esc_str.ToString();
25862586
}
25872587

2588-
private bool IsItemContainer(XmlNodeList nodes)
2588+
private static bool IsItemContainer(XmlNodeList nodes)
25892589
{
25902590
bool result = false;
25912591
if (nodes.Count != 0)
@@ -2935,7 +2935,7 @@ private bool ContainResourceValue(object sessionobj, string ResourceURI, string
29352935

29362936
#endregion "WsMan linking Operations"
29372937

2938-
private string GetURIWithFilter(string uri, Hashtable cmdlinevalues)
2938+
private static string GetURIWithFilter(string uri, Hashtable cmdlinevalues)
29392939
{
29402940
StringBuilder sburi = new StringBuilder(uri);
29412941
if (cmdlinevalues != null)
@@ -2960,7 +2960,7 @@ private string GetURIWithFilter(string uri, Hashtable cmdlinevalues)
29602960
return sburi.ToString();
29612961
}
29622962

2963-
private string GetFilterString(Hashtable cmdlinevalues, string[] pkey)
2963+
private static string GetFilterString(Hashtable cmdlinevalues, string[] pkey)
29642964
{
29652965
StringBuilder filter = new StringBuilder();
29662966
foreach (string key in pkey)
@@ -2979,7 +2979,7 @@ private string GetFilterString(Hashtable cmdlinevalues, string[] pkey)
29792979
return filter.ToString();
29802980
}
29812981

2982-
private bool IsPKey(string value, string ResourceURI)
2982+
private static bool IsPKey(string value, string ResourceURI)
29832983
{
29842984
bool result = false;
29852985
if (ResourceURI.Contains(WSManStringLiterals.containerListener))
@@ -2998,7 +2998,7 @@ private bool IsPKey(string value, string ResourceURI)
29982998
return result;
29992999
}
30003000

3001-
private bool CheckPkeysArray(Hashtable values, string value, string[] pkeys)
3001+
private static bool CheckPkeysArray(Hashtable values, string value, string[] pkeys)
30023002
{
30033003
bool result = false;
30043004
if (values != null)
@@ -3239,7 +3239,7 @@ private PSObject BuildHostLevelPSObjectArrayList(object objSessionObject, string
32393239
/// </summary>
32403240
/// <param name="xmlnode"></param>
32413241
/// <returns></returns>
3242-
private PSObject ConvertToPSObject(XmlNode xmlnode)
3242+
private static PSObject ConvertToPSObject(XmlNode xmlnode)
32433243
{
32443244
PSObject mshObject = new PSObject();
32453245
foreach (XmlNode node in xmlnode.ChildNodes)
@@ -3275,7 +3275,7 @@ private PSObject ConvertToPSObject(XmlNode xmlnode)
32753275
return mshObject;
32763276
}
32773277

3278-
private string SetXPathString(string uri)
3278+
private static string SetXPathString(string uri)
32793279
{
32803280
string parent = uri.Substring(uri.LastIndexOf(WSManStringLiterals.WinrmPathSeparator.ToString(), StringComparison.OrdinalIgnoreCase) + 1);
32813281
if (parent.Equals(WSManStringLiterals.containerWinrs, StringComparison.OrdinalIgnoreCase))
@@ -3307,7 +3307,7 @@ private string SetXPathString(string uri)
33073307
return parent;
33083308
}
33093309

3310-
private string SetSchemaPath(string uri)
3310+
private static string SetSchemaPath(string uri)
33113311
{
33123312
string schemapath = string.Empty;
33133313
uri = uri.Remove(0, WinrmRootName[0].Length);
@@ -3334,7 +3334,7 @@ private string SetSchemaPath(string uri)
33343334
/// <param name="path"></param>
33353335
/// <param name="host"></param>
33363336
/// <returns></returns>
3337-
private string NormalizePath(string path, string host)
3337+
private static string NormalizePath(string path, string host)
33383338
{
33393339
string uri = string.Empty;
33403340
if (path.StartsWith(host, StringComparison.OrdinalIgnoreCase))
@@ -3660,7 +3660,7 @@ private string GetCorrectCaseOfName(string ChildName, string hostname, string pa
36603660
return result;
36613661
}
36623662

3663-
private ArrayList RemoveItemfromResourceArray(ArrayList resourceArray, string ChildName, string type, string property)
3663+
private static ArrayList RemoveItemfromResourceArray(ArrayList resourceArray, string ChildName, string type, string property)
36643664
{
36653665
if (resourceArray != null)
36663666
{
@@ -4519,7 +4519,7 @@ private void GetChildItemsOrNames(string path, ProviderMethods methodname, bool
45194519
/// <param name="CurrentPluginName"></param>
45204520
/// <param name="path"></param>
45214521
/// <returns></returns>
4522-
private int GetPluginNames(XmlDocument xmlPlugins, out PSObject PluginNames, out string CurrentPluginName, string path)
4522+
private static int GetPluginNames(XmlDocument xmlPlugins, out PSObject PluginNames, out string CurrentPluginName, string path)
45234523
{
45244524
PluginNames = new PSObject();
45254525
CurrentPluginName = string.Empty;
@@ -4627,7 +4627,7 @@ private void StartWSManService(bool force)
46274627
/// </summary>
46284628
/// <param name="host"></param>
46294629
/// <returns></returns>
4630-
private bool IsPathLocalMachine(string host)
4630+
private static bool IsPathLocalMachine(string host)
46314631
{
46324632
bool hostfound = false;
46334633
// Check is Localhost
@@ -4684,7 +4684,7 @@ private bool IsPathLocalMachine(string host)
46844684

46854685
#region Plugin private functions
46864686

4687-
private void GenerateObjectNameAndKeys(Hashtable InputAttributes, string ResourceURI, string ContainerItem, out string ItemName, out string[] keys)
4687+
private static void GenerateObjectNameAndKeys(Hashtable InputAttributes, string ResourceURI, string ContainerItem, out string ItemName, out string[] keys)
46884688
{
46894689
StringBuilder sbHashKey = new StringBuilder();
46904690
string keysColumns = string.Empty;
@@ -4717,7 +4717,7 @@ private void GenerateObjectNameAndKeys(Hashtable InputAttributes, string Resourc
47174717
keys = keysColumns.Split('|');
47184718
}
47194719

4720-
private void ProcessCertMappingObjects(XmlDocument xmlCerts, out Hashtable Certcache, out Hashtable Keyscache)
4720+
private static void ProcessCertMappingObjects(XmlDocument xmlCerts, out Hashtable Certcache, out Hashtable Keyscache)
47214721
{
47224722
Hashtable lCache = new Hashtable();
47234723
Hashtable kCache = new Hashtable();
@@ -4775,7 +4775,7 @@ private void ProcessCertMappingObjects(XmlDocument xmlCerts, out Hashtable Certc
47754775
Keyscache = kCache;
47764776
}
47774777

4778-
private void ProcessListenerObjects(XmlDocument xmlListeners, out Hashtable listenercache, out Hashtable Keyscache)
4778+
private static void ProcessListenerObjects(XmlDocument xmlListeners, out Hashtable listenercache, out Hashtable Keyscache)
47794779
{
47804780
Hashtable lCache = new Hashtable();
47814781
Hashtable kCache = new Hashtable();
@@ -4836,7 +4836,7 @@ private void ProcessListenerObjects(XmlDocument xmlListeners, out Hashtable list
48364836
Keyscache = kCache;
48374837
}
48384838

4839-
private PSObject ProcessPluginConfigurationLevel(XmlDocument xmldoc, bool setRunasPasswordAsSecureString = false)
4839+
private static PSObject ProcessPluginConfigurationLevel(XmlDocument xmldoc, bool setRunasPasswordAsSecureString = false)
48404840
{
48414841
PSObject objConfiglvl = null;
48424842

@@ -4877,7 +4877,7 @@ private PSObject ProcessPluginConfigurationLevel(XmlDocument xmldoc, bool setRun
48774877
return objConfiglvl;
48784878
}
48794879

4880-
private ArrayList ProcessPluginResourceLevel(XmlDocument xmldoc, out ArrayList arrSecurity)
4880+
private static ArrayList ProcessPluginResourceLevel(XmlDocument xmldoc, out ArrayList arrSecurity)
48814881
{
48824882
ArrayList Resources = null;
48834883
ArrayList nSecurity = null;
@@ -4963,7 +4963,7 @@ private ArrayList ProcessPluginResourceLevel(XmlDocument xmldoc, out ArrayList a
49634963
return Resources;
49644964
}
49654965

4966-
private ArrayList ProcessPluginInitParamLevel(XmlDocument xmldoc)
4966+
private static ArrayList ProcessPluginInitParamLevel(XmlDocument xmldoc)
49674967
{
49684968
ArrayList InitParamLvl = null;
49694969
if (xmldoc != null)
@@ -5001,7 +5001,7 @@ private ArrayList ProcessPluginInitParamLevel(XmlDocument xmldoc)
50015001
return InitParamLvl;
50025002
}
50035003

5004-
private ArrayList ProcessPluginSecurityLevel(ArrayList arrSecurity, XmlDocument xmlSecurity, string UniqueResourceID, string ParentResourceUri)
5004+
private static ArrayList ProcessPluginSecurityLevel(ArrayList arrSecurity, XmlDocument xmlSecurity, string UniqueResourceID, string ParentResourceUri)
50055005
{
50065006
// ArrayList SecurityLvl = null;
50075007
if (xmlSecurity != null)
@@ -5063,7 +5063,7 @@ private ArrayList ProcessPluginSecurityLevel(ArrayList arrSecurity, XmlDocument
50635063
///<param name="securities">List of Securities</param>
50645064
///<param name="initParams">List of initialization parameters.</param>
50655065
/// <returns>An Configuration XML, ready to send to server.</returns>
5066-
private string ConstructPluginXml(PSObject objinputparam, string ResourceURI, string host, string Operation, ArrayList resources, ArrayList securities, ArrayList initParams)
5066+
private static string ConstructPluginXml(PSObject objinputparam, string ResourceURI, string host, string Operation, ArrayList resources, ArrayList securities, ArrayList initParams)
50675067
{
50685068
StringBuilder sbvalues = new StringBuilder();
50695069
sbvalues.Append("<PlugInConfiguration ");
@@ -5089,7 +5089,7 @@ private string ConstructPluginXml(PSObject objinputparam, string ResourceURI, st
50895089

50905090
if (WSManStringLiterals.ConfigRunAsPasswordName.Equals(prop.Name, StringComparison.OrdinalIgnoreCase))
50915091
{
5092-
prop.Value = this.GetStringFromSecureString(prop.Value);
5092+
prop.Value = GetStringFromSecureString(prop.Value);
50935093
}
50945094

50955095
// ... Name="Value"
@@ -5191,7 +5191,7 @@ private object ValidateAndGetUserObject(string configurationName, object value)
51915191
/// if the propertyValue provided is not SecureString appends empty string.
51925192
/// </summary>
51935193
/// <param name="propertyValue">Value to append.</param>
5194-
private string GetStringFromSecureString(object propertyValue)
5194+
private static string GetStringFromSecureString(object propertyValue)
51955195
{
51965196
SecureString value = propertyValue as SecureString;
51975197
string passwordValueToAdd = string.Empty;
@@ -5206,7 +5206,7 @@ private string GetStringFromSecureString(object propertyValue)
52065206
return passwordValueToAdd;
52075207
}
52085208

5209-
private string ConstructResourceXml(PSObject objinputparams, ArrayList resources, ArrayList securities)
5209+
private static string ConstructResourceXml(PSObject objinputparams, ArrayList resources, ArrayList securities)
52105210
{
52115211
StringBuilder sbvalues = new StringBuilder(string.Empty);
52125212
if (objinputparams == null && resources == null)
@@ -5293,7 +5293,7 @@ private string ConstructResourceXml(PSObject objinputparams, ArrayList resources
52935293
return sbvalues.ToString();
52945294
}
52955295

5296-
private string ConstructSecurityXml(PSObject objinputparams, ArrayList securities, string strResourceIdentity)
5296+
private static string ConstructSecurityXml(PSObject objinputparams, ArrayList securities, string strResourceIdentity)
52975297
{
52985298
// <Security Uri="" ExactMatch="false" Sddl="O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;ER)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)"/>
52995299
StringBuilder sbvalues = new StringBuilder(string.Empty);
@@ -5320,7 +5320,7 @@ private string ConstructSecurityXml(PSObject objinputparams, ArrayList securitie
53205320
return sbvalues.ToString();
53215321
}
53225322

5323-
private void AddSecurityProperties(
5323+
private static void AddSecurityProperties(
53245324
PSMemberInfoCollection<PSPropertyInfo> properties,
53255325
StringBuilder sbValues)
53265326
{
@@ -5345,7 +5345,7 @@ private void AddSecurityProperties(
53455345
sbValues.Append("</Security>");
53465346
}
53475347

5348-
private string ConstructInitParamsXml(PSObject objinputparams, ArrayList initparams)
5348+
private static string ConstructInitParamsXml(PSObject objinputparams, ArrayList initparams)
53495349
{
53505350
// <InitializationParameters>
53515351
// <Param Name="Param1" Value="Value1" />
@@ -5397,7 +5397,7 @@ private string ConstructInitParamsXml(PSObject objinputparams, ArrayList initpar
53975397
return sbvalues.ToString();
53985398
}
53995399

5400-
private string ConstructCapabilityXml(object[] capabilities)
5400+
private static string ConstructCapabilityXml(object[] capabilities)
54015401
{
54025402
StringBuilder sbvalues = new StringBuilder(string.Empty);
54035403
foreach (object cap in capabilities)
@@ -5413,7 +5413,7 @@ private string ConstructCapabilityXml(object[] capabilities)
54135413
return sbvalues.ToString();
54145414
}
54155415

5416-
private bool IsValueOfParamList(string name, string[] paramcontainer)
5416+
private static bool IsValueOfParamList(string name, string[] paramcontainer)
54175417
{
54185418
bool result = false;
54195419
foreach (string value in paramcontainer)

src/Microsoft.WSMan.Management/CurrentConfigurations.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void RemoveOneConfiguration(string pathToNodeFromRoot)
131131
{
132132
if (nodeToRemove is XmlAttribute)
133133
{
134-
this.RemoveAttribute(nodeToRemove as XmlAttribute);
134+
RemoveAttribute(nodeToRemove as XmlAttribute);
135135
}
136136
}
137137
else
@@ -217,7 +217,7 @@ public string GetOneConfiguration(string pathFromRoot)
217217
/// Removes the attribute from OwnerNode.
218218
/// </summary>
219219
/// <param name="attributeToRemove">Attribute to Remove.</param>
220-
private void RemoveAttribute(XmlAttribute attributeToRemove)
220+
private static void RemoveAttribute(XmlAttribute attributeToRemove)
221221
{
222222
XmlElement ownerElement = attributeToRemove.OwnerElement;
223223
ownerElement.RemoveAttribute(attributeToRemove.Name);

0 commit comments

Comments
 (0)