Commit graph

55 commits

Author SHA1 Message Date
Steve Lee 597bfc9696
Update Concise ErrorView to not show line information for errors from script module functions (#14912) 2021-03-08 23:37:11 +05:00
Steve Lee 887467eb32
Add minimal progress bar using ANSI rendering (#14414) 2021-02-05 10:50:20 -08:00
Steve Lee bc080921bf
Add support to $PSStyle for strikethrough and hyperlinks (#14461) 2020-12-19 11:54:51 +05:00
Steve Lee a99ea2acd2
Enable ANSI formatting via $PSStyle and support suppressing ANSI output (#13758) 2020-12-11 10:33:57 -08:00
Dongbo Wang 2728574df7
Rename 'Get-Subsystem' to 'Get-PSSubsystem' and fix two minor issues (#13765) 2020-10-14 09:42:37 -07:00
Steve Lee 36ba1092a8
Fix case where exception message contains "`n" on Windows (#13684) 2020-09-24 23:43:33 +05:00
Steve Lee d25d964d57
Fix ConciseView for interactive advanced function writing error (#13623) 2020-09-14 11:07:37 -07:00
Dongbo Wang fc4c9cbfd7
Initial work of the subsystem plugin model (for minimal powershell) (#13186) 2020-08-20 17:41:44 -07:00
Thomas Nieto bedd3bc287
Remove AssemblyInfo property from list views (#13331) 2020-08-05 12:17:09 -07:00
Steve Lee ec20043a91
Remove use of Test-Path in ConciseView (#12778) 2020-06-11 16:07:18 +05:00
Dan Thompson 0137920d89
Make module formatting not generate error with strict mode (#11943) 2020-05-27 15:43:01 -07:00
Steve Lee b7cb335f03
Update copyright notice to latest guidance (#12190) 2020-03-24 11:08:37 -07:00
Ilya 43e0e1a1c5
Fix default formatting for deserialized MatchInfo (#11728)
MatchInfo class has ToEmphasizedString() member method to color output line.
In remote scenario MatchInfo class is deserialized as Deserialized.Microsoft.PowerShell.Commands.MatchInfo without the method. As result default formating in remote scenario show nothing.

The fix is to directly output Line property.
2020-03-18 18:43:01 +05:00
Dongbo Wang 348ca85947
Fix ConciseView to split PositionMessage using [Environment]::NewLine (#12010) 2020-03-04 13:03:08 -08:00
Steve Lee 2db8516a8c
Fix ConciseView to not show the line information within the error messages (#11952) 2020-02-26 21:07:57 +05:00
Steve Lee 34f9b43514
Fix ConciseView where error message is wider than window width and doesn't have whitespace (#11880) 2020-02-20 08:38:28 +05:00
Steve Lee 5edafb6afd
Fix ConciseView to handle case where there isn't a console to obtain the width (#11784) 2020-02-12 11:48:58 +05:00
Steve Lee 66912b7428
Fix unnecessary trimming of line resulting in incorrect indexi… (#11670) 2020-01-30 11:03:39 -08:00
Ilya ac069185d6
Fix NRE in ConsiceView (#11435)
Use LanguagePrimitives.TryConvertTo() as last resort to string conversion.
2020-01-14 08:33:16 +05:00
Steve Lee 5b42126f7c Don't format exceptions that aren't ErrorRecords (#11415)
* In one of the previous PRs for ConciseView, System.Exception was incorrectly added to the typenames handled by the ErrorRecord formatting. This results in just Exception objects written to the console to not be rendered since the ErrorRecord formatting didn't handle this situation. Fix is to remove the line to add that type putting it back to how it was previously. 

* Also made the handling of ErrorRecord a bit more robust just in case Exception.Message doesn't exist nor a Message property.
2019-12-21 09:45:44 +05:00
Steve Lee a1066ac0ac Use PositionMessage for the line context information for ConciseView (#11398) 2019-12-19 09:42:37 -08:00
Steve Lee 563b1cba83 Add trailing line number to filename for ConciseView (#11391) 2019-12-18 14:05:56 -08:00
Steve Lee ab6b41dce3 Remove unnecessary newline in ConciseView (#11383)
* Add newline only if it's missing
2019-12-18 10:22:01 +05:00
Steve Lee edd3e7680c Move Set-StrictMode to outer scriptblock for ErrorView (#11381) 2019-12-17 23:43:47 +05:00
Steve Lee 6e4da244c5 Update ConciseView to use TargetObject if applicable (#11075) 2019-12-10 09:50:51 -08:00
Steve Lee 2f672538b2 Add Type member to Exceptions containing type of exception for Get-Error (#11076) 2019-11-22 12:57:52 -08:00
Steve Lee 9b71696e33 Add OutputType to Get-Error cmdlet and preserve original typenames (#10856)
- Added OutputType attribute. 
- Cmdlet adds the PSExtendedError typename and removes Exception and ErrorRecord typenames so that the formatting is used. The formatter then removes PSExtendedError and puts back the original typename so that $Error should be the same before calling Get-Error. 
- While testing, had to make some changes to how InvocationInfo is retrieved so that ParseException which contains a nested ErrorRecord which as InvocationInfo is handled correctly. 
- Combined Exception and ErrorRecord formatter into one.
2019-11-19 08:54:58 +05:00
Joel Sallow (/u/ta11ow) 440837944a Test-Connection - Improve Logic and Output (#10697) 2019-11-18 11:32:59 -08:00
Steve Lee 2a45ccc787 Fix ConciseView to show Activity instead of myCommand (#11007)
ConciseView shows MyCommand as the prefix to the error message, but for a scriptblock, MyCommand is the whole scriptblock. Fix is to use CategoryInfo.Activity if available first. Also handle case where it's a script function by seeing if it's a command and showing MyCommand in that case rather than the Activity.
2019-11-10 16:21:10 +05:00
Steve Lee edda43dfb4 Fix use of accent colors for hosts that don't support them (#10937) 2019-10-30 12:24:25 -07:00
Steve Lee 4ff9924cbf Add $env:__SuppressAnsiEscapeSequences to control whether to… (#10814) 2019-10-24 12:45:26 -07:00
Steve Lee 3806c396b1 Disable strict mode in Get-Error formatting script (#10800) 2019-10-18 14:42:17 -07:00
Steve Lee d8d32d79c2 Implement Get-Error cmdlet as Experimental Feature (#10727) 2019-10-15 14:32:14 -07:00
Joel Sallow (/u/ta11ow) 2e951793af Format-Hex: Improve mixed-collection piped input and piped streams of input (#8674) 2019-10-15 11:04:45 -07:00
Steve Lee 36bc894d9b For ConciseView, show line context information if multiple lines but no scriptname (#10746) 2019-10-10 16:06:43 +05:00
Derek Xia 4a4dc4c751 Adds emphasis to Select-String default formatter (#8963) 2019-10-08 16:11:10 -07:00
Steve Lee bce5b20d2d Update ConciseView to remove unnecessary text and not color entire line in red (#10724) 2019-10-08 14:14:23 -07:00
Steve Lee 8cf9c01800 Add ConciseView for $ErrorView (#10641) 2019-10-04 16:52:57 -07:00
Steve Lee 77ddec1614 Add back newline for grouping with Format-Table and -Property (#10653) 2019-10-02 12:11:55 -07:00
Steve Lee 828d12c237 Expose PreRelease label in PSModuleInfo formatter (#10316) 2019-08-09 16:36:53 +05:00
Keith Hill 482c64b35f Display Duration when displaying HistoryInfo (#9751) 2019-06-20 13:39:41 -07:00
Paul Higinbotham aeb601892d Fix Get-Runspace runspace object format Type column (#9438) 2019-05-01 16:01:30 -07: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 f17601298b Reset output attributes if column had ESC char when using Format-Table; Replace ... with unicode ellipsis (#8326)
change ellipsis when truncating to single unicode character
reset console output if previous column contains ESC
update existing format-table tests

If content included a VT100 ESC sequence (like changing color), this affected all output after that cell in the table.  Fix is to detect that a cell contained ESC and reset the console after it.  Also, change the 3 character ellipsis `...` to use the single unicode character `…` so that more text is available.

Fix https://github.com/PowerShell/PowerShell/issues/7767
2018-12-11 13:56:46 -08:00
Ilya 745e305ac5
Add new Offset and Count parameters to Format-Hex and refactor the cmdlet (#7877)
- Add new Offset and Count parameters.
- Modify ByteCollection class to support offsets up to UInt64.MaxValue size.
- Hide/obsolete Raw parameter because the behavior is by default.
- Optimize conversion to bytes to reduce allocations for large input data.
2018-10-18 10:03:59 +05:00
Ilya 17fd2e9392 Revert "Only display properties with values for MeasureInfo (#7104)" (#7754)
This reverts commit 87ccd0aa40 until
security review of the public api has been completed.
2018-10-11 12:48:46 -07:00
Staffan Gustafsson 87ccd0aa40 Only display properties with values for MeasureInfo (#7104)
* Adding support for built-in List formats to include ItemSelectionCondition
* Adding ItemSelectionCondition to GenericMeasureInfo
* Adding tests for MeasureInfo format-list
* Adding positive tests
2018-08-28 08:18:56 +05:00
Aditya Patwardhan 4e7c2ed663 Fix several issues in Markdown cmdlets (#7329)
- Formatting file should be used for `MarkdownOptionInfo` object instead of the types file for adding script property.
- Downlevel windows consoles which do not support VT100 escape sequences should be handled gracefully.
- Add helpuri fwlink for cmdlets.
- Make `-Path` a positional parameter for `ConvertFrom-Markdown`
- make `-InputObject` a positional parameter for `Set-MarkdownOption`
2018-07-27 17:26:35 -07:00
Robert Holt c94fc31f97 Enforce the 'CompatiblePSEditions' check for modules from the legacy 'System32' module path (#7183)
- Add `%WINDIR%\System32\WindowsPowerShell\v1.0\Modules` (Windows PowerShell $PSHOME) to the end of the default PSCore 6 module path (i.e. the module path as initially set at startup).
- Cause an error to be thrown by `Import-Module` when a module with `CompatiblePSEditions` not containing `"Core"` is being loaded from the 'System32' module path.
- Suppress output of modules listed by `Get-Module -ListAvailable` from Windows PowerShell $PSHOME when `CompatiblePSEditions` does not contain `"Core"`.
- Introduce the `-SkipCompatibilityCheck` switch parameter on both `Import-Module` and `Get-Module` to respectively allow importing incompatible modules and listing incompatible modules.
- Adds a  `PSEdition` column to the `PSModuleInfo` table view format.
- Ensures that completions are not given for incompatible modules on the System32 module path.
2018-07-16 16:58:40 -07:00
Dongbo Wang 2c9519ba3b [Feature] Address Feedback: Use better error message and add more tests 2018-07-10 02:14:59 -07:00