Commit graph

87 commits

Author SHA1 Message Date
xtqqczze be9b14a296
Remove unnecessary Array -> List -> Array conversion in ProcessBaseCommand.AllProcesses (#15052) 2021-04-12 09:24:41 -07:00
Henry Buckle 9aede0558a
Remove the 32,767 character limit on the environment block for Start-Process (#14111) 2021-03-02 15:05:55 -08:00
xtqqczze b7a431a442
Fix SA1504: All accessors should be single-line or multi-lin (#14241)
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1504.md
2021-01-09 12:44:38 +05:00
xtqqczze 9f1f676207
Fix IDE0090: Simplify new expression part 2 (#14200)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0090
2020-11-26 10:43:29 +05:00
xtqqczze 09ae5d729b
Fix CA1822: Mark members as static part 3 (#14226)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1822
2020-11-24 12:12:00 +05:00
xtqqczze fa8b94e6e9
Fix SA1122: Use string.Empty for empty strings (#14218)
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1122.md
2020-11-23 14:09:20 +05:00
xtqqczze 0db5e8f3c9
Fix various xml documentation issues (#14223)
* Use correct paramref tag

* End summary tag in correct position

* Escape generic identifiers correctly

* https://github.com/DotNetAnalyzers/DocumentationAnalyzers/blob/master/docs/DOC202.md

* Remove extraneous space
2020-11-23 14:07:48 +05:00
xtqqczze 83688be8a4
Enable SA1002: Semicolons should be spaced correctly (#14197)
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1002.md
2020-11-21 19:30:59 +05:00
xtqqczze cba73e724f
Enable SA1106: Code should not contain empty statements (#13964)
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1106.md
2020-11-21 19:26:44 +05:00
xtqqczze 5c874207ec
Enable CA1837: Use 'Environment.ProcessId' (#14063)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1837
2020-11-13 08:47:23 +05:00
xtqqczze 4d2965af29
Autofix SA1518: The code must not contain extra blank lines at the end of the file (#13574) 2020-11-11 12:15:20 +05:00
xtqqczze 8cdc421051
Remove unnecessary usings part 3 (#14021)
* Fix IDE0005: Remove unnecessary import

https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005

* Sort usings
2020-11-10 08:18:03 +05:00
xtqqczze 76be8f3ce5
Fix RCS1033: Remove redundant boolean literal part 1 (#13454)
* Remove redundant boolean literal

Autofix RCS1033: Remove redundant boolean literal

* revert changes in System.Management.Automation
2020-11-05 22:23:27 +05:00
xtqqczze 3ba61069b8
Enable IDE0054: Use compound assignment (#13546)
* Autofix IDE0054
https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0054-ide0074
2020-11-05 09:48:13 +05:00
xtqqczze 03a0ef26e6
Fix RCS1098: Constant values should be on right side of comparisons (#13833)
* Fix RCS1098: Constant values should be on right side of comparisons

https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1098.md
2020-11-05 09:13:12 +05:00
xtqqczze 52ecb6d18e
Run dotnet-format to improve formatting of source code (#13503) 2020-11-04 11:13:56 -08:00
xtqqczze bcca5f4adb
Fix IDE0044: MakeFieldReadonly part 3 (#13886)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-10-29 16:03:50 +05:00
Dongbo Wang 10237bdeb3
Update PowerShell to build against dotnet 5.0-RC.1 (#13643) 2020-09-23 14:04:01 -07:00
Robert Holt 6a37eb9313
Update to .NET 5 preview 8 (#13530) 2020-08-31 10:38:05 -07:00
xtqqczze 16f0b74187
Cleanup: Remove redundant empty lines (#13404) 2020-08-25 11:29:26 -07:00
Dongbo Wang 4b9b0788ed
Revert "Use is null syntax (#13277)" (#13322)
This reverts commit 6c03776d74.
2020-07-30 16:06:38 -07:00
xtqqczze 6c03776d74
Use is null syntax (#13277)
Replace `== null` with `is null`
2020-07-30 18:04:03 +05:00
xtqqczze 58c371ca31
Fix RCS1114: Remove redundant delegate creation (#12917) 2020-06-11 14:01:01 +05:00
Bryan Berns edf7cc0ead
Resolve the working directory as literal path for Start-Process when it's not specified (#11946) 2020-06-09 10:27:53 -07:00
xtqqczze e93381e73e
Add readonly modifier to internal static members (#11777)
# PR Summary

* Add readonly modifier to internal static members.

## PR Context

## PR Checklist

- [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
    - Use the present tense and imperative mood when describing your changes
- [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress).
    - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready.
- **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)**
    - [x] None
    - **OR**
    - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md)
        - [ ] Experimental feature name(s): <!-- Experimental feature name(s) here -->
- **User-facing changes**
    - [x] Not Applicable
    - **OR**
    - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
        - [ ] Issue filed: <!-- Number/link of that issue here -->
- **Testing - New and feature**
    - [x] N/A or can only be tested interactively
    - **OR**
    - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting)
- **Tooling**
    - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
    - **OR**
    - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include:
        - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host).
        - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
        - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions).
        - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors).
2020-05-31 05:10:22 +00:00
xtqqczze 05cab7fa5a
Formatting: Add empty line between declarations (#12824)
# PR Summary

Automated fixes:
* RCS0013: Add empty line between single-line declarations of different kind
* RCS010: Add empty line between declarations

## PR Context


## PR Checklist

- [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
    - Use the present tense and imperative mood when describing your changes
- [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress).
    - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready.
- **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)**
    - [x] None
    - **OR**
    - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md)
        - [ ] Experimental feature name(s): <!-- Experimental feature name(s) here -->
- **User-facing changes**
    - [x] Not Applicable
    - **OR**
    - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
        - [ ] Issue filed: <!-- Number/link of that issue here -->
- **Testing - New and feature**
    - [x] N/A or can only be tested interactively
    - **OR**
    - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting)
- **Tooling**
    - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
    - **OR**
    - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include:
        - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host).
        - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
        - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions).
        - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors).
2020-05-29 04:56:33 +00:00
xtqqczze 9212aac0fa
Use nameof operator (#12716)
# PR Summary

Using *Roslynator Command Line Tool version 0.1.0.4*

* Fix RCS1015:
  * `"argument"` → `nameof(argument)`
  * `enum.ToString()` → `nameof(enum)`

[RCS1015.log](https://github.com/PowerShell/PowerShell/files/4646102/RCS1015.log)


## PR Context

<!-- Provide a little reasoning as to why this Pull Request helps and why you have opened it. -->

## PR Checklist

- [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
    - Use the present tense and imperative mood when describing your changes
- [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress).
    - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready.
- **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)**
    - [x] None
    - **OR**
    - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md)
        - [ ] Experimental feature name(s): <!-- Experimental feature name(s) here -->
- **User-facing changes**
    - [x] Not Applicable
    - **OR**
    - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
        - [ ] Issue filed: <!-- Number/link of that issue here -->
- **Testing - New and feature**
    - [x] N/A or can only be tested interactively
    - **OR**
    - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting)
- **Tooling**
    - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
    - **OR**
    - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include:
        - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host).
        - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
        - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions).
        - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors).
2020-05-19 18:57:52 +00:00
Ilya 264bcb3fda
Update UseNewEnvironment parameter behavior of Start-Process cmdlet on Windows (#10830) 2020-04-17 17:19:13 -07:00
Steve Lee b7cb335f03
Update copyright notice to latest guidance (#12190) 2020-03-24 11:08:37 -07:00
David Smatlak 3923ca1728 Fixes FWLinks for PS7 online help documents (#11071) 2019-12-02 10:25:56 -08:00
Ilya d58a82ad19
Cleanup: use the built-in type alias (#10882) 2019-11-06 08:47:32 +05:00
Ilya 7e423e7451
Fix minor style issues come from last commits (#9640) 2019-06-07 08:35:33 +05:00
Ilya 83708a4242
Use new string.ConCat() in Process.cs (#9720) 2019-06-01 23:51:25 +05:00
Ilya bd6fdae735
Cleanup: sort usings (#9490) 2019-04-30 10:25:11 +05:00
Ilya 7dc17a35a9 Enhance the P/Invoke code for LookupAccountSid in Process.cs (#9197) 2019-03-26 21:11:25 -07:00
Ilya a47c1b3113
Minor cleanups in Process.cs (#9195)
* Use string.Join
* Use char const
2019-03-23 09:46:33 +05:00
Muhammed Imran 6f6b7983b0 Suggest "-Id pid" for "Get-Process pid" (#8959) 2019-03-01 17:01:52 +05:00
Ilya 11ae24fcad
Cleanup dllimport (#8847) 2019-02-27 08:33:46 +05:00
Ilya 233b54ed65 Style: Add a space after "//" in comments and remove unneeded comments after "}" (#8576) 2019-01-05 17:51:20 -08:00
Ilya 1be3f4cc0e Style: Add the ending period to the XML document texts (#8577) 2019-01-05 15:40:24 -08:00
Ilya dfd2f69369
Style: Change 'String.' to 'string.' (#8568) 2018-12-31 20:44:16 +05:00
Ilya 56569b9315
Style: Replace String.IsNullOrEmpty with string.IsNullOrEmpty (#8557) 2018-12-31 15:10:15 +05:00
Ilya 7207db6360
Style: Convert to upper first char in <param> and <exception> doc tags (#8556) 2018-12-29 08:25:49 +05:00
Ilya 479fc64aff
Style: Add period before </param> and </exception> doc tags (#8553) 2018-12-28 16:39:06 +05:00
Ilya 767c13fca1
Style: Remove extra spaces after <para> and before </para> docs tags (#8547) 2018-12-28 11:05:14 +05:00
Ilya 871ce5696d
Style: Add period before returns doc tag (#8535)
- add period before "</returns>" doc tag
- remove extra space before "</returns>" doc tag
- convert first char after "<returns>" doc tag to upper case
2018-12-25 21:43:03 +05:00
Steve Lee 4af3068566 Code cleanup: Add space after closing brace where needed (#8530)
* Update TestService

* Update WebListener

* Update Controllers

* Update ExpTest

* Update MyApp

* Update Logic

* Update Logic

* Update MyApp

* Update Microsoft.Management.Infrastructure.CimCmdlets

* Update Microsoft.PowerShell.Commands.Diagnostics

* Update Microsoft.PowerShell.ScheduledJob

* Update Microsoft.WSMan.Management

* Update Microsoft.WSMan.Runtime

* Update ResGen

* Update TypeCatalogGen

* Update commands

* Update Eventing

* Update Reader

* Update utility

* Update ShowCommand

* Update trace

* Update WebCmdlet

* Update Common

* Update CoreCLR

* Update common

* Update format-object

* Update format-wide

* Update out-file

* Update out-printer

* Update out-string

* Update OutGridView

* Update LocalAccounts

* Update Commands

* Update security

* Update CoreCLR

* Update DscSupport

* Update engine

* Update help

* Update logging

* Update namespaces

* Update security

* Update utils

* Update config

* Update perfCounters

* Update tracing

* Update cmdletization

* Update other

* Update cim

* Update xml

* Update CoreCLR

* Update common

* Update DefaultFormatters

* Update out-console

* Update out-textInterface

* Update DisplayDatabase

* Update Utilities

* Update COM

* Update ComInterop

* Update CommandCompletion

* Update debugger

* Update ExperimentalFeature

* Update hostifaces

* Update interpreter

* Update lang

* Update Modules

* Update parser

* Update runtime

* Update client

* Update commands

* Update common

* Update fanin

* Update server

* Update WireDataFormat

* Update Binding

* Update Operations

* Update interface

* Update cmdletization

* Update cim

* Update management

* Update WindowsTaskbarJumpList

* Update msh
2018-12-24 11:20:06 +05:00
Ilya 0a4f33a872
Replace StringComparision.CurrentCulture with StringComparision.Ordinal (#8068) 2018-10-21 16:11:08 +05:00
Ilya d97c9e701b Bulk update format for files in Management folder with codeformatter (#7346) 2018-07-26 10:14:09 -07:00
Steve Lee 06960346a1 Enable UseShellExecute on all platforms (#7198)
Previously, we limited use of UseShellExecute when starting a new process to only Windows Desktop.  However, CoreFx now supports UseShellExecute (appropriately calling `open` on macOS and `xdg-open` on Linux) so we can have a consistent code and remove some of the existing redundant code or unnecessary limiting code.
2018-07-02 12:50:19 -07:00