Berkan Diler
8619d8432f
Make use of StringSplitOptions.TrimEntries when possible ( #18412 )
2022-10-31 22:20:22 +05:00
Berkan Diler
9016adf1c2
Replace some string.Join(string) calls with string.Join(char) ( #18411 )
2022-10-31 09:56:15 -07:00
Ilya
8965af3d52
Remove some static constants from Utils.Separators ( #18154 )
2022-10-27 15:25:41 -07:00
Dongbo Wang
bc1f3691f2
Make the fuzzy searching flexible by passing in the fuzzy matcher ( #18270 )
2022-10-17 16:40:54 -07:00
Steve Lee
918bb8c952
Make experimental feature PSExec stable ( #18045 )
2022-09-07 10:28:17 -07:00
Frode Flaten
4b4f1d144f
Use null propagation operator in /engine ( #17789 )
2022-07-29 09:06:07 +05:00
Dmitry Volodin
1779175935
Use null-coalescing assignment in the rest of /engine ( #17729 )
2022-07-26 12:31:14 -07:00
Ikko Ashimine
42d0e99286
Fix typo in ModuleCmdletBase.cs ( #17714 )
...
explictly -> explicitly
2022-07-20 10:17:53 +05:00
MartinGC94
edac193cf0
Use discards for unused variables ( #17620 )
2022-07-05 14:26:51 -07:00
Shuangchi He
8cc39848bc
Fix some typos in source code ( #17481 )
2022-06-06 10:14:53 -07:00
James Truher [MSFT]
65d8f11aeb
Update telemetry collecting with a few changes ( #17304 )
2022-05-16 17:10:51 -07:00
Andrew and Travis Plunk
c3b7e10fd0
Merged PR 20126: Fix for partial PowerShell module search paths, that can be resolved to CWD locations ( #17231 )
...
The problem is .NET will return empty strings for special folders that don't exist in some accounts (like System account), and the module path code appends path locations without first checking if the root path is non-empty. This results in partial paths in the PSModulePath list, which are then interpreted by .NET file APIs as rooted in the current working directory. And this in turn can allow low privilege users to drop modules in locations that higher privilege accounts will load from, thus gaining escalated privilege code execution.
These changes detect this non-rooted condition and prevents partial paths from being included in search lists.
Cherry picked from !17201
Co-authored-by: Travis Plunk <tplunk@microsoft.com >
2022-05-01 13:04:58 +05:00
Dongbo Wang
e1f52dda77
Refactor module assembly loading logic to allow the whole module to be loaded in a custom ALC ( #16889 )
2022-02-23 15:01:12 -08:00
Aditya Patwardhan
77caf718cd
Update projects and scripts to use .NET 7 preview 1 pre-release builds ( #16856 )
...
* Update script to consume .NET 7 builds
* Update target framework
* Add dotnet metadata override value
* Update dependencies
* Update analyzer
* Conditionally add output argument
* Update files.wxs
* Fix tests
* Update Microsoft.PowerShell.Native to 7.3.0-preview.1
* Disable psget tests
* Update to latest build for .NET 7 preview 1
* Disable ready to run
* Update version of `Microsoft.AspNetCore.Mvc.NewtonsoftJson` package
* Update cgmanifest and startup test
2022-02-16 09:56:41 -08:00
Dongbo Wang
cce64f49de
Report error when PowerShell built-in modules are missing ( #16628 )
2022-01-12 10:02:03 -08:00
Steve Lee
a9b14a13fd
Add exec cmdlet for bash compatibility ( #16462 )
2022-01-04 14:09:27 -08:00
Paul Higinbotham
1ec61d955c
Remove implicit remoting batch experimental feature ( #15863 )
...
It was decided by committee (#15862 ) to remove this experimental feature. It was an interesting idea but the implementation did not cover important cases, and could not be updated easily to do so.
2021-08-13 08:34:31 +05:00
xtqqczze
58483e1366
Replace GetFiles in CompletionCompleters ( #14329 )
2021-08-05 16:35:38 -07:00
xtqqczze
883ca98dd7
Seal private classes ( #15725 )
...
* Seal private classes
* Fix CS0509
* Fix CS0628
2021-07-19 14:09:12 +05:00
xtqqczze
00bc0f6d29
Enable IDE0030: UseCoalesceExpressionForNullable ( #14289 )
2021-07-13 10:13:49 -07:00
xtqqczze
6d08db612e
Use List<T>.RemoveAll to avoid creating temporary list ( #15686 )
2021-07-07 20:54:44 -07:00
xtqqczze
4c2d6dcfca
Make classes sealed ( #15675 )
...
Fix [RCS1225](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1225.md )
2021-07-04 16:49:52 +05:00
Dongbo Wang
e2ee8e7e1f
Clean up code regarding AppDomain.CreateDomain and AppDomain.Unload ( #15554 )
2021-06-10 09:16:05 -07:00
xtqqczze
a562fa6bd8
Enable SA1008 Opening parenthesis should be spaced correctly ( #14242 )
2021-04-16 13:33:02 -04:00
Staffan Gustafsson
1feed0671a
Enable nullable for System.Management.Automation.Tracing.IMethodInvoker ( #14157 )
2021-04-16 13:25:15 -04:00
Ilya
91e7298fd8
Use static lambda keyword ( #15154 )
2021-04-12 12:44:05 -07:00
Mariano Alipi
ae5a84ea05
Move misplaced test file to tests directory ( #14908 )
2021-03-08 23:51:38 +05:00
xtqqczze
778cff0292
Avoid array allocations from GetDirectories and GetFiles ( #14327 )
...
Contributes to PowerShell#14318.
2021-02-16 10:31:02 -08:00
Andrew
8e3c3e04f8
Cross-platform updates to DSC code in PowerShell ( #13399 )
2021-02-02 14:47:53 -08:00
xtqqczze
9ea718f171
Enable CA2249: Consider using String.Contains instead of IndexOf ( #14395 )
...
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2249
2021-01-10 18:15:02 +05:00
xtqqczze
8315515494
Avoid array allocations from GetDirectories/GetFiles. ( #14326 )
2021-01-10 18:09:26 +05: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
50fd950920
Enable CA1052: Static holder types should be Static or NotInheritable ( #14483 )
...
* Enable CA1052: Static holder types should be Static or NotInheritable
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/CA1052
* Fix SA1505
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1505.md
2021-01-08 22:53:11 +05:00
xtqqczze
9d4665f32f
Enable SA1003: Symbols should be spaced correctly ( #14476 )
...
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1003.md
2020-12-23 21:21:26 +05:00
Staffan Gustafsson
06b660cb5a
Enable nullable: System.Management.Automation.IModuleAssemblyInitializer ( #14158 )
2020-12-09 12:33:17 -08:00
xtqqczze
f74acaa768
Replace GetFiles in TestModuleManifestCommand ( #14317 )
2020-12-09 11:59:08 -08: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
0d1ea73e59
Enable IDE0074: Use coalesce compound assignment ( #13396 )
...
* Autofix IDE0074: Use compound assignment
2020-11-25 17:37:01 +05:00
xtqqczze
c7bdb24ff3
Mark local variable as const ( #13217 )
...
RCS1118: Mark local variable as const https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1118.md
2020-11-24 20:06:16 +05:00
xtqqczze
fa6caf957e
Use see keyword in documentation ( #14220 )
...
Fix [DOC104](https://github.com/DotNetAnalyzers/DocumentationAnalyzers/blob/master/docs/DOC104.md )
2020-11-24 09:35:46 +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
d05530fbd0
Wrap and name LoadBinaryModule arguments ( #14193 )
2020-11-21 19:34:52 +05:00
xtqqczze
03e596bf51
Wrap and name GetListOfFilesFromData arguments ( #14194 )
2020-11-21 19:34:02 +05:00
xtqqczze
fcafb7f57d
Code performance fixes follow-up ( #14207 )
2020-11-20 15:29:58 -08:00
xtqqczze
99a49e0eab
Enable SA1131: Use readable conditions ( #14132 )
...
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1131.md
2020-11-20 17:26:46 +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
9e285298c0
Enable IDE0031: Null check can be simplified ( #13548 )
...
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0031
2020-11-20 11:42:51 +05:00
xtqqczze
b521b858ad
Fix RCS1049: Simplify boolean comparison ( #13994 )
...
* Fix RCS1049: Simplify boolean comparison
https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1049.md
Related https://github.com/dotnet/runtime/pull/44564
2020-11-13 09:39:25 +05:00
xtqqczze
1386d0054a
Remove LINQ Count method uses ( #13545 )
2020-11-11 09:39:59 -08: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