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
Thomas Nieto
f03952fc3c
Remove unnecessary using in utils folder ( #13863 )
2020-11-02 12:47:29 +05:00
Dongbo Wang
10237bdeb3
Update PowerShell to build against dotnet 5.0-RC.1 ( #13643 )
2020-09-23 14:04:01 -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
Steve Lee
b7cb335f03
Update copyright notice to latest guidance ( #12190 )
2020-03-24 11:08:37 -07:00
Ilya
bd6fdae735
Cleanup: sort usings ( #9490 )
2019-04-30 10:25:11 +05:00
Ilya
ceed73d737
Run Codeformatter for SMA ( #9402 )
2019-04-24 19:27:22 +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
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
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
Steve Lee
c1c5344a88
Update copyright and license headers ( #6134 )
...
Based on standard practices, we need to have a copyright and license notice at the top of each source file. Removed existing copyrights and updated/added copyright notices for .h, .cpp, .cs, .ps1, and .psm1 files.
Updated module manifests for consistency to have Author = "PowerShell" and Company = "Microsoft Corporation". Removed multiple line breaks.
Separate PR coming to update contribution document for new source files: #6140
Manually reviewed each change.
Fix #6073
2018-02-13 09:23:53 -08:00
Steve Lee
4bc52d2358
Use consistent '(c)' for copyright symbol ( #5210 )
...
- Remove the year about copyright
- Fix casing of `All rights reserved`
- Replace Unicode characters representing single quote with a single quote
2017-10-26 14:12:19 -07:00
Steve Lee
fb286e6cf8
Removed double spaces from .cs and .ps1 files ( #4743 )
2017-09-04 19:45:51 -07:00
Dongbo Wang
2c43140276
Clean up ClrFacade.cs - remove ClrFacade.SizeOf<T>() ( #4377 )
2017-07-29 17:40:19 -07:00
Steve Lee
40c479d071
Address static analysis issues in SSH remoting ( #4083 )
...
* address static analysis issues
- remoteRunspaces is not used TFS:10618323
- not checking return value of ResumeThread() TFS:10618344
* fixed magic number use
* changed magic number to Uint.MaxValue
2017-06-28 16:27:54 -07:00
Dongbo Wang
7a55bf98b2
Move powershell to .NET Core 2.0 ( #3556 )
...
This change moves powershell to .NET Core 2.0. Major changes are:
1. PowerShell assemblies are now targeting `netcoreapp2.0`. We are using `microsoft.netcore.app-2.0.0-preview1-001913-00`, which is from dotnet-core build 4/4/17. We cannot target `netstandard2.0` because the packages `System.Reflection.Emit` and `System.Reflection.Emit.Lightweight`, which are needed for powershell class, cannot be referenced when targeting `netstandard2.0`.
2. Refactor code to remove most CLR stub types and extension types.
3. Update build scripts to enable CI builds. The `-cache` section is specified to depend on `appveyor.yml`, so the cache will be invalidated if `appveyor.yml` is changed.
4. Ship `netcoreapp` reference assemblies with powershell to fix the issues in `Add-Type` (#2764 ). By default `Add-Type` will reference all those reference assemblies when compiling C# code. If `-ReferenceAssembly` is specified, then we search reference assemblies first, then the framework runtime assemblies, and lastly the loaded assemblies (possibly a third-party one that was already loaded).
5. `dotnet publish` generates executable on Unix platforms, but doesn't set "x" permission and thus it cannot execute. Currently, the "x" permission is set in the build script, `dotnet/cli` issue [#6286 ](https://github.com/dotnet/cli/issues/6286 ) is tracking this.
6. Replace the use of some APIs with the ones that take `SecureString`.
7. osx.10.12 is required to update to `netcoreapp2.0` because `dotnet-cli` 2.0.0-preview only works on osx.10.12.
8. Add dependency to `System.ValueTuple` to work around a ambiguous type identity issue in coreclr. The issue is tracked by `dotnet/corefx` [#17797 ](https://github.com/dotnet/corefx/issues/17797 ). When moving to newer version of `netcoreapp2.0`, we need to verify if this dependency is still needed.
2017-04-17 11:52:38 -07:00
George Chakhidze
47ec6b2a86
Use IntPtr(-1) for INVALID_HANDLE_VALUE instead of IntPtr.Zero ( #3544 )
...
- Fix incorrect handling of 'GetCurrentProcess()' API return value in 'IsWow64()' function (MainEntry.cpp)
- Remove unused INVALID_HANDLE_VALUE field from 'ProcessNativeMethods' class (Process.cs)
2017-04-13 17:00:56 -07:00
Jason Shirk
02b5f357a2
Remove trailing whitespace ( #3001 )
2017-01-16 13:31:14 -08:00
Steve Lee
44eb20dc8f
Fixes #2534 by replacing expensive WMI query with Win32 API calls ( #2535 )
...
* Fixes #2534 by replacing expensive WMI query with Win32 API calls
* fix break on unix build
* added tests for #2535
* although test passed, fixing exception that shows up
* fixed Describe text
* addressing code review feedback
* addressing review feedback to comment on why sleep is needed
added check that test processes are created before we try to kill them
* fixed test to timeout and pending fix for #2561
2016-10-31 09:41:13 -07:00
PaulHigin
44ad7f9e3c
These changes implement PowerShell remoting over SSH. The changes include feedback from code review comments.
2016-08-12 15:47:46 -07:00
PowerShell Team
403ae3f53f
Initial run of code formatter
...
I (Jason Shirk) ran https://github.com/dotnet/codeformatter with the default rules, basically:
codeformatter /nocopyright "/c:DEBUG,UNIX,CORECLR" @files.rsp
This caused a few problems building, which were fixed up manually.
Notable changes:
`this.` is removed unless needed to disambiguate.
private instance fields are renamed to have a `_` prefix.
private static fields are renamed to have a `s_` prefix.
I left some projects alone (like PackageManagement) and also left some generated code alone.
2016-08-01 15:57:03 -07:00
PowerShell Team
60b3b304f2
Move files from psl-monad submodule to super-project
...
This commit uses psl-monad branch source-depot 7209cb9
And corresponds to [SD:688741]
2016-03-30 17:16:23 -07:00