Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 57 additions & 109 deletions src/Microsoft.WSMan.Management/ConfigProvider.cs

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions src/Microsoft.WSMan.Management/CredSSP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ private void DeleteDelegateSettings(string applicationname, RegistryKey rootKey,
bool otherkeys = false;
try
{

string Registry_Path_Credentials_Delegation = Registry_Path + @"\CredentialsDelegation";
RegistryKey Allow_Fresh_Credential_Key = rootKey.OpenSubKey(Registry_Path_Credentials_Delegation + @"\" + helper.Key_Allow_Fresh_Credentials, true);
if (Allow_Fresh_Credential_Key != null)
Expand Down Expand Up @@ -642,7 +641,6 @@ private void UpdateCurrentUserRegistrySettings()
{
string key = GPOpath + "\\" + keyname + "\\" + @"Software\Policies\Microsoft\Windows";
UpdateGPORegistrySettings(applicationname, this.delegatecomputer, Registry.CurrentUser, key);

}
}
// saving gpo settings
Expand Down Expand Up @@ -703,7 +701,6 @@ private void UpdateGPORegistrySettings(string applicationname, string[] delegate
ErrorRecord er = new ErrorRecord(ex, "ArgumentException", ErrorCategory.InvalidOperation, null);
WriteError(er);
}

}

#region IDisposable Members
Expand Down Expand Up @@ -812,7 +809,7 @@ private string GetDelegateSettings(string applicationname)
WriteError(er);
}

return result;
return result;
}
#endregion private

Expand Down Expand Up @@ -929,7 +926,6 @@ protected override void BeginProcessing()
}

#endregion IDisposable Members

}

#endregion
Expand Down
8 changes: 4 additions & 4 deletions src/Microsoft.WSMan.Management/CurrentConfigurations.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Globalization;
using System.Xml;

namespace Microsoft.WSMan.Management
{
using System;
using System.Globalization;
using System.Xml;

/// <summary>
/// Class that queries the server and gets current configurations.
/// Also provides a generic way to update the configurations.
Expand Down
24 changes: 9 additions & 15 deletions src/Microsoft.WSMan.Management/Interop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

namespace Microsoft.WSMan.Management
{

#region "public Api"

#region WsManEnumFlags
Expand Down Expand Up @@ -162,7 +161,7 @@ public enum AuthenticationMechanism
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Credssp")]
Credssp = 0x80,
}
}

#endregion AuthenticationMechanism

Expand Down Expand Up @@ -331,7 +330,6 @@ string CertificateThumbprint
[DispId(1)]
set;
}

}

/// <summary><para><c>IWSManConnectionOptions</c> interface.</para></summary>
Expand Down Expand Up @@ -694,9 +692,9 @@ string Error
[DispId(29)]
int EnumerationFlagAssociatedInstance();
}
#endregion IWsManEx
#endregion IWsManEx

#region IWsManResourceLocator
#region IWsManResourceLocator

/// <summary><para><c>IWSManResourceLocator</c> interface.</para></summary>
[SuppressMessage("Microsoft.Design", "CA1040:AvoidEmptyInterfaces")]
Expand Down Expand Up @@ -737,7 +735,6 @@ public interface IWSManResourceLocator
[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
string ResourceUri
{

// IDL: HRESULT resourceUri (BSTR value);
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "resource")]
[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
Expand All @@ -751,7 +748,6 @@ string ResourceUri
[DispId(1)]
[return: MarshalAs(UnmanagedType.BStr)]
get;

}

/// <summary><para><c>AddSelector</c> method of <c>IWSManResourceLocator</c> interface. </para><para>Add selector to resource locator</para></summary>
Expand Down Expand Up @@ -857,11 +853,10 @@ string Error
[return: MarshalAs(UnmanagedType.BStr)]
get;
}

}
#endregion IWsManResourceLocator
#endregion IWsManResourceLocator

#region IWSManSession
#region IWSManSession
/// <summary><para><c>IWSManSession</c> interface.</para></summary>
[Guid("FC84FC58-1286-40C4-9DA0-C8EF6EC241E0")]
[ComImport]
Expand Down Expand Up @@ -1005,9 +1000,9 @@ int Timeout
}
}

#endregion IWSManSession
#endregion IWSManSession

#region IWSManResourceLocatorInternal
#region IWSManResourceLocatorInternal
/// <summary><para><c>IWSManResourceLocatorInternal</c> interface.</para></summary>
[Guid("EFFAEAD7-7EC8-4716-B9BE-F2E7E9FB4ADB")]
[ComImport]
Expand Down Expand Up @@ -1124,7 +1119,7 @@ void GetMachineName(
uint GetPropertySheetPages(out IntPtr hPages);
}

#endregion IGroupPolicyObject
#endregion IGroupPolicyObject

/// <summary><para><c>GpoNativeApi</c></para></summary>
public sealed class GpoNativeApi
Expand All @@ -1140,8 +1135,7 @@ internal static extern System.IntPtr EnterCriticalPolicySection(
internal static extern bool LeaveCriticalPolicySection(
[In] System.IntPtr hSection);
}
#endregion

#endregion
}

#pragma warning restore 1591
8 changes: 0 additions & 8 deletions src/Microsoft.WSMan.Management/InvokeWSManAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public string ComputerName
{
computername = "localhost";
}

}
}

Expand Down Expand Up @@ -261,15 +260,13 @@ protected override void BeginProcessing()

// create the connection string
connectionStr = helper.CreateConnectionString(connectionuri, port, computername, applicationname);

}

/// <summary>
/// ProcessRecord method.
/// </summary>
protected override void ProcessRecord()
{

try
{
// create the resourcelocator object
Expand All @@ -285,7 +282,6 @@ protected override void ProcessRecord()
XmlDocument xmldoc = new XmlDocument();
xmldoc.LoadXml(resultXml);
WriteObject(xmldoc.DocumentElement);

}
finally
{
Expand All @@ -301,9 +297,7 @@ protected override void ProcessRecord()

if (m_session != null)
Dispose(m_session);

}

}

#region IDisposable Members
Expand Down Expand Up @@ -339,7 +333,5 @@ protected override void EndProcessing()
// WSManHelper helper = new WSManHelper();
helper.CleanUp();
}


}
}
1 change: 0 additions & 1 deletion src/Microsoft.WSMan.Management/NewWSManSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ protected override void BeginProcessing()
}

WriteObject(objSessionOption);

}
}
}
9 changes: 3 additions & 6 deletions src/Microsoft.WSMan.Management/PingWSMan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

namespace Microsoft.WSMan.Management
{

#region Test-WSMAN

/// <summary>
Expand Down Expand Up @@ -138,7 +137,6 @@ public string ApplicationName
/// </summary>
protected override void ProcessRecord()
{

WSManHelper helper = new WSManHelper(this);
IWSManEx wsmanObject = (IWSManEx)new WSManClass();
string connectionStr = string.Empty;
Expand All @@ -152,7 +150,7 @@ protected override void ProcessRecord()
xmldoc.LoadXml(m_SessionObj.Identify(0));
WriteObject(xmldoc.DocumentElement);
}
catch(Exception)
catch (Exception)
{
try
{
Expand All @@ -165,8 +163,8 @@ protected override void ProcessRecord()
this.WriteError(er);
}
}
catch(Exception)
{}
catch (Exception)
{ }
}
finally
{
Expand Down Expand Up @@ -199,7 +197,6 @@ protected override void ProcessRecord()
}

#endregion IDisposable Members

}
#endregion
}
4 changes: 1 addition & 3 deletions src/Microsoft.WSMan.Management/Set-QuickConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ private void QuickConfigRemoting(bool serviceonly)
}

string resultAction = resultopxml.SelectSingleNode(xpathText, nsmgr).InnerText;
if ( source != null && source.Equals("GPO"))
if (source != null && source.Equals("GPO"))
{
string Info_Msg = WSManResourceLoader.GetResourceString("L_QuickConfig_RemotingDisabledbyGP_00_ErrorMessage");
Info_Msg += " " + resultAction;
Expand Down Expand Up @@ -260,7 +260,6 @@ private void QuickConfigRemoting(bool serviceonly)

if (m_SessionObj != null)
Dispose(m_SessionObj);

}
}
#endregion private
Expand Down Expand Up @@ -289,7 +288,6 @@ private void QuickConfigRemoting(bool serviceonly)
}

#endregion IDisposable Members

}
#endregion Set-WsManQuickConfig
}
6 changes: 0 additions & 6 deletions src/Microsoft.WSMan.Management/WSManConnections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ internal void ValidateSpecifiedAuthentication()
[Cmdlet(VerbsCommunications.Connect, "WSMan", DefaultParameterSetName = "ComputerName", HelpUri = "https://go.microsoft.com/fwlink/?LinkId=141437")]
public class ConnectWSManCommand : AuthenticatingWSManCommand
{

#region Parameters

/// <summary>
Expand Down Expand Up @@ -253,7 +252,6 @@ public SwitchParameter UseSSL
/// </summary>
protected override void BeginProcessing()
{

WSManHelper helper = new WSManHelper(this);
if (connectionuri != null)
{
Expand Down Expand Up @@ -283,7 +281,6 @@ protected override void BeginProcessing()

helper.CreateWsManConnection(ParameterSetName, connectionuri, port, computername, applicationname, usessl.IsPresent, Authentication, sessionoption, Credential, CertificateThumbprint);
}

}
#endregion

Expand Down Expand Up @@ -311,7 +308,6 @@ public string ComputerName

set
{

computername = value;
if ((string.IsNullOrEmpty(computername)) || (computername.Equals(".", StringComparison.OrdinalIgnoreCase)))
{
Expand Down Expand Up @@ -343,7 +339,6 @@ public string ComputerName
{
session = null;
this.Dispose();

}

#endregion IDisposable Members
Expand Down Expand Up @@ -379,7 +374,6 @@ protected override void BeginProcessing()
helper.AssertError(helper.GetResourceMsgFromResourcetext("InvalidComputerName"), false, computername);
}
}

}
#endregion Disconnect-WSMAN
}
Loading