Commit Graph
181 Commits
Author SHA1 Message Date
Steve Lee 6c4f27eec1 Remove unused resource strings from SessionStateStrings (#18394) 2022-10-27 09:36:11 -07:00
Steve Lee 0ede377311 Remove unused resource strings in System.Management.Automation (#18388) 2022-10-26 11:04:44 -07:00
Steve Lee 70a0a27f55 Remove unused strings from parser (#18383) 2022-10-26 08:01:33 +05:00
Steve Lee 7cae30de39 Remove unused strings from ConsoleInfoErrorStrings.resx (#18367) 2022-10-24 14:58:51 -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
Dongbo Wang 80d2fb7e47 Some more code cleanup related to the use of PSVersionInfo (#18231) 2022-10-11 10:24:31 -07:00
Ikko Ashimine eb92c501da Fix typos in EventResource.resx (#18063) 2022-09-12 09:13:28 -07:00
Dominik Kaszewski 1ee2f0d7ee Fix Update-Help failing silently with implicit non-US culture. (#17780) 2022-08-09 15:51:32 -07:00
WJKM d75d3b6178 Add the ValidateNotNullOrWhiteSpace attribute (#17191) 2022-08-09 10:48:08 -07:00
Ryan HutchisonandTravis Plunk f2204a08b8 Authenticode https fix issue #12827 (#16134)
* Added https:// as valid prefix for TSA url

* fixed typo

* Format matching

* Added proper logic

* Appended https to error message

* Update src/System.Management.Automation/security/Authenticode.cs

I agree.

Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>

Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
2022-08-01 09:57:03 -07:00
Dongbo Wang f9d424dd86 Fix Export-PSSession to not throw error when a rooted path is specified for -OutputModule (#17671) 2022-07-13 13:31:57 -07:00
Paul Higinbotham a8d55851e0 Add the -ConfigurationFile command line parameter to pwsh to support local session configuration (#17447) 2022-06-06 12:12:53 -07:00
Dongbo Wang 41c7cd79da Fix the error message in Hashtable-to-object conversion (#17329) 2022-05-16 14:55:00 -07:00
Paul HiginbothamandDongbo Wang f6ac9bb604 Add support for new WDAC API (#17247)
* Add support for new WDAC API

* Fix non-Windows platform error

* Fix code factor errors

* Update cgmanifest json file

* Fix test failure

* Update src/System.Management.Automation/resources/SecuritySupportStrings.resx

Co-authored-by: Dongbo Wang <dongbow@microsoft.com>

Co-authored-by: Dongbo Wang <dongbow@microsoft.com>
2022-05-16 14:18:30 -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
Charlton Stanley 5134410d79 Correct Typo in the resource string PathResolvedToMultiple (#17098) 2022-04-12 16:46:23 -07:00
Paul Higinbotham a6d04226c3 Add Custom Remote Connections Feature (#17011)
* Changes for custom remote connections

* Remove NamedPipeConnection dependency on RemoteSessionNamedPipe.

* Enable custom connection tests and tool build for all platforms

* Fix CustomConnection.Tests.ps1

* Fix tests attempt 1

* Fix tool build

* Move test to elevated

* Fix non-Windows pipe name

* Update test for non-Windows

* Skip broken non-Windows timer

* Add comment for skipped test
2022-03-23 08:04:07 -07:00
Paul Higinbotham df460b7275 Add fix of process objects for processes that have exited. (#16946)
* Add fix for process objects for processes that have exited.

* Fix code factor

* Fix typo

* Add try/catch for possible race condition on exiting process.
2022-03-02 13:53:35 -08:00
Dongbo Wang 35ad64e11b Add a couple fixes to generic method invocation (#16822) 2022-02-03 11:58:02 -08:00
Joel Sallow (/u/ta11ow) 8c53252969 Add support to allow invoking method with generic type arguments (#12412) 2022-01-27 09:55:54 -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 64d2fe26f3 Fix PSVersion parameter version checks and error messages for PowerShell 7 remoting (#16228) 2021-12-01 15:54:25 -08:00
Dongbo Wang 979f105a99 Fix parser to generate error when array has more than 32 dimensions (#16276)
An array cannot have more than 32 dimensions. See the doc of MarkArrayType(int rank)) https://docs.microsoft.com/en-us/dotnet/api/system.type.makearraytype?view=net-5.0#System_Type_MakeArrayType_System_Int32_ for details.

The fix is to not create the ArrayTypeName instance when the number of dimensions exceeds 32, but instead, generate a parsing error.
2021-10-29 08:16:26 +05:00
Steve Lee d0e823797f Don't allow Move-Item with FileSystemProvider to move a directory into itself (#16198) 2021-10-12 14:16:32 -07:00
Dongbo Wang a32700a1c1 Add clean block to script block as a peer to begin, process, and end to allow easy resource cleanup (#15177) 2021-10-11 14:49:09 -07:00
Robert Holt a4d14576b3 Make the native command error handling optionally honor ErrorActionPreference (#15897) 2021-08-24 15:27:22 -07:00
Steve Lee a162856af5 Change default to OutputRendering.Host and remove OutputRendering.Automatic (#15882) 2021-08-16 14:17:07 -07: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
Steve Lee 5e15f66f97 Add validation to $PSStyle to reject printable text as ANSI escape sequence (#15825) 2021-07-27 17:14:20 +00:00
Paul Higinbotham 046e0fea03 Fix SSH remoting connection hang with misconfigured endpoint (#15175) 2021-04-13 15:36:36 -07:00
James Truher [MSFT]andIlya a520e2c982 Native invocation using ArgumentList (#14692)
Co-authored-by: Ilya <darpa@yandex.ru>
2021-04-01 14:54:10 -07:00
Andrew 8e3c3e04f8 Cross-platform updates to DSC code in PowerShell (#13399) 2021-02-02 14:47:53 -08:00
Steve Lee a99ea2acd2 Enable ANSI formatting via $PSStyle and support suppressing ANSI output (#13758) 2020-12-11 10:33:57 -08:00
Ilya d9090b4a49 Write better error message if config file is broken (#13496) 2020-11-13 17:22:26 -08:00
Dongbo Wang fc4c9cbfd7 Initial work of the subsystem plugin model (for minimal powershell) (#13186) 2020-08-20 17:41:44 -07:00
James Truher [MSFT] f8b9e8e9db Create warnings when UTF7 is specified as an encoding (#13430) 2020-08-17 22:19:22 -07:00
Dongbo Wang 4214800690 Refresh and enable the ComInterop code in PowerShell (#13304) 2020-08-07 16:24:10 -07:00
Christopher Yeleighton 8626937ac4 Change "operable" to "executable" (#13281)
* Change "operable" to "executable" in a resource string
2020-08-06 13:02:43 +05:00
Christopher Yeleighton babf02768b Fix error message from new symbolic link missing target (#13085) 2020-07-03 12:54:26 +05:00
Paul Higinbotham 9a92c62d30 Add null check for Windows PowerShell install path (#12296)
Some Azure images have run into this problem where Start-Job fails even when running in pwsh child process rather than Windows PowerShell child. Fix is to guard against the missing registry entry.
2020-04-14 11:05:26 +05:00
Aleksandar Nikolić 1fa0a00728 Change "PowerShell Core" to "PowerShell" in a resource string (#11928) 2020-03-12 18:04:29 -07:00
Paul Higinbotham 00b60c44fa Remove hop restriction for interactive sessions (#11920) 2020-02-28 12:26:08 -08:00
John Dennis 895d4b3f3e Allow cross-platform CAPI-compatible remote key exchange (#11185) 2020-02-19 12:28:43 -08:00
Andrew 43c88a4ff1 Add WinCompat deny list support using a setting in powershell.… (#11726) 2020-02-04 16:33:26 -08:00
xtqqczze 70d9ed4d55 Remove Unicode BOM from text files (#11546) 2020-01-11 12:15:34 +05:00
Andrew ea48e07c48 Added setting to disable implicit WinPS module loading (#11332) 2020-01-03 10:32:00 -08:00
Steve Lee 1f9c3c2abd Update error message if Update-Help fails for the current UICulture (#11356) 2019-12-20 15:16:26 -08:00
Tyler James Leonhardt ca202da643 Improvements in breakpoint APIs for remote scenarios (#11312) 2019-12-12 17:23:12 -08:00
Andrew 0c46e3e71d Added WindowsPS version check for WinCompat (#11148) 2019-12-10 10:40:13 -08:00