Commit Graph
281 Commits
Author SHA1 Message Date
Travis Plunk 137b4d788b Fix for JEA session leaking functions (#19024) 2023-02-01 16:19:51 -08:00
spaette d29f34b5c2 typos (#19058) 2023-01-30 09:48:00 -08:00
CarloToso 33ba57387d Use interpolated strings 12 (#19003) 2023-01-23 22:35:20 +05:00
CarloToso 9cab34b7a7 Use interpolated strings 5c (#18997) 2023-01-21 17:49:12 +05:00
Ikko Eltociear Ashimine 66a2371b6e Fix typo in ModuleCmdletBase.cs (#18933)
Implict -> Implicit
2023-01-12 12:00:47 +05:00
James Truher [MSFT] 4f57804f46 Fix up all comments to be in the proper order with proper spacing (#18619) 2023-01-03 12:12:42 -08:00
CarloToso 2ddc63f151 Replace ArgumentNullException(nameof()) -> ArgumentNullException.ThrowIfNull() (#18784) 2022-12-14 18:30:33 +05:00
Patrick Meinecke 74aa257839 Skip cloud files marked as "not on disk" during command discovery (#18152) 2022-11-08 14:37:29 -08:00
Steve Lee 0ddf89e5a8 Fix Switch-Process to copy the current env to the new process (#18452) 2022-11-07 11:03:37 -08:00
xtqqczze 1688b0fc35 Replace UTF8Encoding(false) with Encoding.Default (#18356) 2022-11-07 10:07:36 -08:00
Steve Lee a2ee05400f Fix Switch-Process to set termios appropriate for child process (#18467) 2022-11-04 15:12:09 -07:00
Steve Lee 52a62e9ef2 Fix Switch-Process error to include the command that is not found (#18443) 2022-11-03 07:54:11 +05:00
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
AndrewandTravis 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