Commit Graph
245 Commits
Author SHA1 Message Date
xtqqczze 1790f3a3e9 Remove redundant Attribute suffix (#24940) 2025-02-07 22:18:29 +05:00
Steve Lee 9ceae0c544 Add support to Get-Error to handle BoundParameters (#20640)
* Add support to `Get-Error` to handle BoundParameters

* sort the keys

* change to generalize for all dictionaries

* address Patrick's comment to generalize and use one codepath for dictionaries

* address codefactor
2024-08-26 19:25:16 -04:00
Steve Lee 59bce18372 Fix Get-FormatData to not cast a type incorrectly (#21157) 2024-08-26 13:32:09 -07:00
Justin Grote 5ae0fbd547 RecommendedAction: Explicitly start and stop ANSI Error Color (#24065) 2024-07-29 16:52:11 -07:00
Justin Grote 7ad43292a8 Add RecommendedAction to ConciseView of the error reporting (#20826) 2024-04-15 10:35:23 -07:00
Patrick Meinecke 1dc2ebe5bc Fix error formatting for pipeline enumeration exceptions (#20211) 2024-03-04 12:58:06 -08:00
xtqqczze 0e106faafe Enable CA1868: Unnecessary call to 'Contains' for sets (#21165)
https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1868
2024-02-29 22:56:22 +05:00
Steve Lee a880377d8a Fix a regression in Format-Table when header label is empty (#21156) 2024-02-26 11:44:30 -08:00
Jordan Borean 4f02a89906 Fix Get-Error serialization of array values (#21085)
Ensure Get-Error does not hang when attempting to serialize an exception
that contains a property whose type is an array of System.Type
instances. Also ensures that primitive types like System.Int32,
System.Boolean as well as System.String is formatted as a string rather
than an object with properties.
2024-01-24 08:41:18 +05:00
Dongbo Wang ac559185d0 Add Aliases to the properties shown up when formatting the help content of the parameter returned by Get-Help (#20994) 2024-01-09 11:21:31 -08:00
James Truher [MSFT] 77e8021256 Set experimental features to stable for 7.4 release (#20285) 2023-09-22 17:01:22 -07:00
Thomas Nieto 39513bb3fb Remove parenthesis for empty attribute parameters (#20087) 2023-08-21 10:11:55 -07:00
Dmitry Volodin a26b09d71e Apply the InlineAsTypeCheck in the engine code - 2nd pass (#19694) 2023-07-10 17:17:08 -07:00
Aditya Patwardhan ebe0b54340 Update to .NET 8 Preview 4 (#19696) 2023-06-21 15:17:22 -07:00
Jack CaseyandTravis Plunk 698742ea9f Test-Connection: Increase output detail when performing a tcp test (#11452)
* Added verbose TCP test logic

* Cleaned up output, removed source IP address

* Consolidated detailed output logic into ProcessConnectionByTCPPort()

* Updated existing tests with -Quiet switch

* Improved output formatting, changed logic to match

* Error handling and logic improvements

* Updated tests to match new output

* Updated logic, tcp tests now run once by default

* Moved TcpConnectionTestResult enum into TcpTestStatus class

* Removed unnecessary whitespace

* Wrapped TcpClient() in Using statement

* Appended missing period on comments

* Change TcpTestStatus to TcpPortStatus for better clarity

* Set default count back to 4

* Move stopwatch reset into finally block

* Change TcpConnectionTestResult.New to TcpConnectionTestResult.None

* Formatting fixes

* Increase column size for Result output

* Update logic for -quiet option

* Change "TestNum" property to "Id"

* Change Destination and DestinationAddress to Target and TargetAddress in TcpPortStatus

* Implement new form of using declaration

* Fix indentation

* Update output, improve logic and update tests

* Add CancellationToken to allow cancel before timeout

* Assign testResult.Connected to client.Connected

* Move TcpPortStatus object creation to after connection test

* Remove delay from final connection test in loop

* Move Count logic from ProcessConnectionByTCPPort into own function

* Fix small formatting error

* Add handling for TaskCanceledException

* Remove redundant CancellationToken getter

* Clean up handling of SocketException

* Increase readability of final loop check

* Remove unnecessary TimeSpan invocation

* Rename cancellationTokenSource to match convention

* Move SetCountForTcpTest() into BeginProcessing()

* Added nameof to Count check

* Removed explicit type declaration for TcpClient

* Move delay and timeout evaluation out of the cycle

* Remove redundant CancellationTokenSource

* Initialize detailed SwitchParameter

* Add check for Detailed parameter

* Remove redundant tests for non-detailed output

* Add return after first boolean output

* Update tests with new detailed parameter set

---------

Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
2023-05-01 14:16:11 -07:00
Ikko Eltociear Ashimine 9d1756efa7 Fix typo in typeDataXmlLoader.cs (#19319) 2023-03-14 08:56:14 +05:00
Steve Lee 66a89826bb Fix PlainText output to correctly remove Reset VT sequence w/o number (#19283) 2023-03-07 14:18:16 -08:00
CarloToso 0d6b93a23f Fix codefactor if part 2 (#19267) 2023-03-04 22:30:14 +05:00
Steve Lee ec258e210f Fix ConciseView to handle custom ParserError error records (#19239) 2023-03-01 11:18:11 -08:00
Dongbo Wang 79b4b5c33f Update the FeedbackProvider interface to return structured data (#19133) 2023-02-22 16:01:18 -08:00
Dongbo Wang 4756506d22 Fix error formatting to remove the unneeded leading newline for concise view (#19080) 2023-02-08 09:54:08 -08:00
spaette ec0eb22062 Fix typos in comments (#19064) 2023-02-03 10:40:43 +05:00
spaette d29f34b5c2 typos (#19058) 2023-01-30 09:48:00 -08:00
Dongbo Wang 3a17d0230f Update additional interpolated string changes (#19029) 2023-01-25 13:39:21 -08:00
Dongbo Wang b195088c5a Revert some of the interpolated string changes (#19018) 2023-01-25 09:46:47 -08:00
CarloToso 4c586a7a86 Use interpolated strings 11 (#19002) 2023-01-23 22:36:26 +05:00
CarloToso 64d82f812d Use interpolated strings 9 (#18993) 2023-01-20 15:26:43 +05:00
CarloToso f5627538e1 Use interpolated strings 7 (#18985) 2023-01-20 12:21:19 +05:00
CarloToso a01fb37243 Use interpolated strings 8 (#18988) 2023-01-20 09:50:51 +05:00
Steve Lee 2baeb1a7f0 Fix Get-Error to work with strict mode (#18895) 2023-01-13 18:00:20 +05:00
Dongbo Wang eb31d32724 Enable creating composite subsystem implementation in modules (#18888) 2023-01-05 09:51:45 -08:00
Steve Lee f04940b76c Fix Format-Table -RepeatHeader for property derived tables (#18870) 2022-12-31 12:00:00 +05:00
CarloToso 2ddc63f151 Replace ArgumentNullException(nameof()) -> ArgumentNullException.ThrowIfNull() (#18784) 2022-12-14 18:30:33 +05:00
Steve Lee 52ea419662 Add Dim and DimOff to $PSStyle (#18653) 2022-11-29 16:13:59 -08:00
Steve Lee 65b353d9cf The command prefix should also be in the error color for NormalView (#18555) 2022-11-15 17:54:23 -08:00
Ilya 8965af3d52 Remove some static constants from Utils.Separators (#18154) 2022-10-27 15:25:41 -07:00
Dongbo Wang 53c3690c2a Replace command-error suggestion with new implementation based on subsystem plugin (#18252) 2022-10-24 11:59:32 -07:00
xtqqczze 152887154e Remove some static initializations in StringManipulationHelper (#18243) 2022-10-19 14:18:24 -07:00
Steve Lee d5ed53eba2 Add CustomTableHeaderLabel formatting to differentiate table header labels that are not property names (#17346) 2022-10-03 15:05:11 -07:00
Dongbo Wang a7a49290a8 Remove the extra new line form List formatting (#18185) 2022-09-30 15:47:51 -07:00
Dongbo Wang 618d1a7c78 Minor update to the FileInfo table formatting on Unix to make it more concise (#18183) 2022-09-29 16:22:53 -07:00
Dongbo Wang 647f40bb4a Fix error formatting to use color defined in $PSStyle.Formatting (#17987) 2022-08-31 09:36:14 -07:00
Dongbo Wang 543f5209c0 Support mapping foreground/background ConsoleColor values to VT escape sequences (#17938) 2022-08-24 23:11:18 +05:00
Frode Flaten d204d29035 Use null propagation operator in System.Management.Automation (#17792) 2022-08-01 09:20:09 -07:00
Dmitry Volodin 8f6b75826e Use compound assignment in /System.Management.Automation (#17724) 2022-07-25 22:07:33 +05:00
Steve Lee 1437d85a44 Fix legacy ErrorView types to use $host.PrivateData colors (#17705) 2022-07-18 17:07:47 -07:00
Steve Lee 08baf27b80 Render decimal numbers in a table using current culture (#17650) 2022-07-18 14:27:06 -07:00
Dongbo Wang 17e4db9b1b Make Out-String and Out-File keep string input unchanged (#17455) 2022-06-08 18:13:40 -07:00
Dongbo Wang 6a522d9c68 Make AnsiRegex able to capture Hyperlink ansi sequences (#17442)
* Add the hyperlink ansi regex

* Add test

* Add comment
2022-06-08 10:35:07 -07:00
Shuangchi He 8cc39848bc Fix some typos in source code (#17481) 2022-06-06 10:14:53 -07:00