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
2 changes: 1 addition & 1 deletion .globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ dotnet_diagnostic.SA1120.severity = none
dotnet_diagnostic.SA1121.severity = none

# SA1122: Use string.Empty for empty strings
dotnet_diagnostic.SA1122.severity = none
dotnet_diagnostic.SA1122.severity = warning

# SA1123: Do not place regions within elements
dotnet_diagnostic.SA1123.severity = none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected override void StopProcessing()
/// Run a command.
/// </summary>
protected void RunCommand(String command, String args) {
String cmd = "";
String cmd = string.Empty;

_process = new Process()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private void RetrieveMatchingProcessesById()
catch (ArgumentException)
{
WriteNonTerminatingError(
"",
string.Empty,
processId,
processId,
null,
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.WSMan.Management/ConfigProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ protected override void SetItem(string path, object value)
{
if (!Force)
{
string query = "";
string query = string.Empty;
string caption = helper.GetResourceMsgFromResourcetext("SetItemGeneralSecurityCaption");
if (ChildName.Equals("TrustedHosts", StringComparison.OrdinalIgnoreCase))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected override void EndProcessing()

if (CommandName == null || CommandName.Length == 0)
{
CommandName = new[] { "" };
CommandName = new[] { string.Empty };
}

for (int i = 0; i < CommandName.Length; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2345,7 +2345,7 @@ internal PSModuleInfo LoadModuleManifest(
key: "FileList",
manifestProcessingFlags,
moduleBase,
extension: "",
extension: string.Empty,
// Don't check file existence - don't want to change current behavior without feature team discussion.
verifyFilesExist: false,
out List<string> fileList))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ protected override void StartPipelineExecution()
}

default:
Debug.Fail("");
Debug.Fail(string.Empty);
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2236,7 +2236,7 @@ internal static PowerShell GetCommandDiscoveryPipeline(object data)
}
else
{
module = new string[] { "" };
module = new string[] { string.Empty };
}

ModuleSpecification[] fullyQualifiedName = null;
Expand Down
2 changes: 1 addition & 1 deletion src/powershell/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private static int ExecPwshLogin(string[] args, string pwshPath, bool isMacOS)
//
// Since command_name is ignored and we can't use null (it's the terminator)
// we use empty string
execArgs[4] = "";
execArgs[4] = string.Empty;

// Add the arguments passed to pwsh on the end.
args.CopyTo(execArgs, 5);
Expand Down