mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 09:43:57 +08:00
Fix CA1839: Use 'Environment.ProcessPath' (#15650)
This commit is contained in:
parent
170a226689
commit
8337d2afd6
@ -447,7 +447,7 @@ dotnet_diagnostic.CA1838.severity = silent
|
||||
|
||||
# CA1839: Use 'Environment.ProcessPath'
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1839
|
||||
dotnet_diagnostic.CA1839.severity = suggestion
|
||||
dotnet_diagnostic.CA1839.severity = warning
|
||||
|
||||
# CA1840: Use 'Environment.CurrentManagedThreadId'
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1840
|
||||
|
@ -64,7 +64,7 @@ namespace TestExe
|
||||
for (uint i = 0; i < num; i++)
|
||||
{
|
||||
Process child = new Process();
|
||||
child.StartInfo.FileName = Process.GetCurrentProcess().MainModule.FileName;
|
||||
child.StartInfo.FileName = Environment.ProcessPath;
|
||||
child.StartInfo.Arguments = "-createchildprocess";
|
||||
child.Start();
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ namespace PSTests.Parallel
|
||||
{
|
||||
directoryObject = new DirectoryInfo(System.Environment.CurrentDirectory);
|
||||
fileObject = new FileInfo(System.Reflection.Assembly.GetEntryAssembly().Location);
|
||||
executableObject = new FileInfo(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);
|
||||
executableObject = new FileInfo(Environment.ProcessPath);
|
||||
}
|
||||
|
||||
Assert.Equal("d----", FileSystemProvider.Mode(PSObject.AsPSObject(directoryObject)).Replace("r", "-"));
|
||||
|
Loading…
Reference in New Issue
Block a user