Commit graph

30 commits

Author SHA1 Message Date
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
Dongbo Wang dc2d741791 Add logging, formatting, and '$EnabledExperimentalFeatures' 2018-07-06 13:28:19 -07: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 3a81c2b58f Enable setting PSSession Name when using SSHTransport and added Transport property (#5954)
When using New-PSSession -SSHTransport -Name ... the Name parameter wasn't being used when creating the remoterunspace so an automatically generated one was always created.
Fix is to explicitly pass the transport name when generating a runspace name including other transports like VMBus and Container.

Refactor runspace name generation code to produce "RunspaceN" and added a Transport property.

Tests will have to wait until we have the infrastructure for remoting tests and Enable-SSHRemoting work is complete.

Fix #5951
Fix #2426
2018-02-04 13:12:48 -08:00
Mark Kraus f5f3fab1ea Clean Up Full CLR Code From Web Cmdlets (#5376) 2017-11-10 22:00:11 +04:00
Jason Shirk 237ccbdf6d Use wider columns for process id and user (#5303)
I also moved all the formatting code higher up in the tree, it never felt like it belonged where it was.
2017-11-02 07:56:24 -07:00
Renamed from src/System.Management.Automation/commands/utility/FormatAndOutput/common/DefaultFormatters/PowerShellCore_format_ps1xml.cs (Browse further)