Commit graph

50 commits

Author SHA1 Message Date
MartinGC94 965dc8f40f
Fix tab completion within the script block specified for the ValidateScriptAttribute. (#14550) 2021-11-09 18:26:14 -08:00
Andrew 8d017d8a75
Move cross platform DSC code to a subsystem (#15127) 2021-05-20 17:06:59 -07:00
MartinGC94 55d12ee76c
Add completion for Requires statements (#14596) 2021-04-14 10:26:48 -07:00
Ilya 91e7298fd8
Use static lambda keyword (#15154) 2021-04-12 12:44:05 -07:00
Andrew 8e3c3e04f8
Cross-platform updates to DSC code in PowerShell (#13399) 2021-02-02 14:47:53 -08:00
MartinGC94 e26d7084e2
Improve completion of parameters for attributes (#14525) 2021-01-14 09:30:15 +05:00
xtqqczze c909541b77
Mark private members as static part 9 (#14234)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1822
2020-11-27 13:10:43 +05:00
xtqqczze f14c76aab9
Enable SA1516: Elements should be separated by blank line (#14137)
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1516.md
2020-11-20 16:11:36 +05:00
xtqqczze 76cef3b299
Fix RCS1221: Use pattern matching instead of combination of 'as' operator and null check (#13333)
* Autofix RCS1221: Use pattern matching instead of combination of 'as' operator and null check

https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1221.md

* Restore stripped comments
2020-11-05 21:58:48 +05:00
xtqqczze 03a58c4186
Use is not syntax part 2 (#13338) 2020-11-05 10:23:50 +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 af8558b065
Enable CA1834: Consider using 'StringBuilder.Append(char)' when applicable (#13878)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1834
2020-10-30 12:07:18 +05:00
Dongbo Wang fc4c9cbfd7
Initial work of the subsystem plugin model (for minimal powershell) (#13186) 2020-08-20 17:41:44 -07:00
xtqqczze 4597b41396
Use is not syntax where appropriate and remove unnecessary parentheses (#13323) 2020-07-31 16:41:59 -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 bd90f1921f
Code performance fixes (#12956)
* RCS1080: Use 'Count/Length' property instead of 'Any' method

* RCS1077: Optimize LINQ method call

* RCS1235: Optimize method call
2020-06-25 11:30:40 +05:00
Steve Lee b7cb335f03
Update copyright notice to latest guidance (#12190) 2020-03-24 11:08:37 -07:00
Ilya b5d4739b2a
Use span-based overloads (#11884) 2020-03-18 18:38:55 +05:00
Aditya Patwardhan 2579c00a20 Support null-conditional operators ?. and ?[] in PowerShell language (#10960) 2019-11-15 16:39:53 -08:00
Steve Lee 0842fe8b8d Enable tab completion for variable assignment that is enum (#10646) 2019-10-14 09:53:11 -07:00
Ilya 74c87ab20b Cleanup: Use EndsWith(char) and StartsWith(char) (#9994) 2019-06-25 11:02:31 -07:00
Bruce Payette 6bc6257a55 Allow .exe files to be used as IL binary modules (#7281)
Fix for #6741 Allow .exe files to be used as binary modules. Basically anywhere a .dll could be used with modules, you can now use a .exe file. Also did a little clean up, replacing constant strings with the StringLiteral values instead.
2019-02-07 11:24:06 -08: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
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
Dongbo Wang 289981a017 Change 'String' to 'string' for simple references (#8519) 2018-12-22 14:26:06 +05:00
Travis Plunk 79f21b41de
Consolidation of all Windows PowerShell work ported to PSCore6 (#8257)
Consolidation of all Windows PowerShell work ported to PSCore6

* Added ps1 file import restriction.  Refactored InvokeLanguageModeTestingSupportCmdlet to HelpersSecurity module
* JEA loop back fix.  Debugger running commands in CL mode.
* Support for new AMSI codes.  Changed to use AMSI buffer API.  Unhandled exception fix.
* Fixes for module bugs while running in ConstrainedLanguage mode
* Untrusted input tracking work
* Configuration keyword bug fix, PSRP protocol version check for reconstruct reconnect, Sharing InitialSessionState in runspace pool.
* Restricted remote session in UMCI, Applocker detection collision, Help command exposing functions, Null reference exception fix.
* Added mitigation for debugger function exposure
2018-11-13 16:16:29 -08:00
Ilya 5d03e1653a
Remove empty xml comment lines (#7401) 2018-08-01 10:39:13 +05:00
Dongbo Wang 10334220e8 Address Feedback: functional changes and method/variable renaming 2018-07-09 17:14:34 -07:00
Dongbo Wang eed9842534 First batch: Basic experimental feature flag and attributes enforced 2018-07-06 13:28:18 -07:00
Ilya e177fcaef6 CodeFactor code style cleanup: replace literal empty strings with 'string.Empty' (#6950) 2018-06-12 12:30:10 -07:00
Ilya 626a83bcd4
Fix tab completions for a hash table (#6839)
Now working:
- Get-Date | Sort-Object @{Expression=<tab>
- Get-Date | Sort-Object @{Expression=...;<tab>
2018-05-21 09:05:59 +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
Dongbo Wang db33d90479 First round of workflow cleanup (#4777)
This round of cleanup focuses on the following areas
- Tab completion code
- InitialSessionState
- Compiler/MiscOps
- Utils/SessionStateFunctionAPIs
Changes in the rest affected files are mainly some corresponding changes due to the cleanup work in the above areas.
2017-09-11 08:55:13 -07:00
Dongbo Wang 6d32293437 Add more tab completion tests (#4356)
* Add more TabCompletion tests

* Minor changes

* Add some more tests

* Add more tab completion tests

* Fix errors

* Add more test coverage

* Add 'AfterEach { Pop-Location }'

* Enable DSC resource name completion and address comments

* use both '/' and '\' in the path for completion

* Use a separate test for '\' and '/'
2017-08-03 15:26:20 -07:00
Staffan Gustafsson 3125764476 Fix bug where native.exe --<tab> would not call native completer (#3633) 2017-06-07 16:34:44 -07:00
Staffan Gustafsson a52adcd3cf Adding support for Typeinference based on runtime variable values (#2744)
* Refactored the type inference code in preparation to make it a public api.
* Added type inference tests

Fixes #2567
2017-06-07 15:52:33 -07:00
Staffan Gustafsson 5bdcff5ad9 Fix tab completion with '@{<tab>' to avoid crash in PSReadline (#3626) 2017-04-25 09:42:43 -07:00
Jason Shirk 02b5f357a2 Remove trailing whitespace (#3001) 2017-01-16 13:31:14 -08:00
Jason Shirk (POWERSHELL) 386b4f37f4 Remove CheckForSevereException and private FailFast
Our private implementation of FailFast was likely introduced
when each individual application needed it's own code to
get Watson reports. The CLR takes care of this for us now,
so we don't need our implementation.

Our method CheckForSevereException was also introduced in
the early days of the CLR - the exceptions it was checking
for aren't actually raised the CLR anymore, they just FailFast.
I removed them as there is a tiny bit of overhead (in code size)
and also in the generated code, e.g. dynamic sites called the method.
2016-12-01 13:46:56 -08:00
Josh Soref 7ec70ee30d spelling: locals in src/System.Management.Automation/engine/CommandCompletion 2016-09-01 14:49:29 +00:00
PowerShell Team c1ee6c9d6d Refactoring - replace always null expressions with null 2016-08-03 12:14:28 -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 8ee6d6ca43 Update files from Source Depot changeset [SD:715912]
Corresponds to 77eda782aa78ba8b7a36c51ee619629ce6c990f2 in psl-monad.
2016-06-15 18:02:03 -07:00
PowerShell Team 3998ce06ba Update files from Source Depot changeset [SD:700586]
Corresponds to 84837459913bb00660964d19ea07f5e0c7b4b442 in psl-monad.
2016-04-28 13:53:04 -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