Commit graph

146 commits

Author SHA1 Message Date
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
Andrew b218e6f6cc Support using non-compatible Windows PowerShell modules in PowerShell Core (#10973) 2019-11-18 10:44:55 -08:00
Dongbo Wang 3768be1b21 Remove the not-working 'run Update-Help from Get-Help when Get-Help runs for the first time' feature (#10974) 2019-11-07 11:54:22 -08:00
Robert Holt 2a518fcfe2 Support the pipeline chain operators && and || in PowerShell language (#9849) 2019-10-17 14:43:46 -07:00
Steve Lee 77ddec1614 Add back newline for grouping with Format-Table and -Property (#10653) 2019-10-02 12:11:55 -07:00
Sotiris Nanopoulos f69f30ba49 Add working directory parameter to Start-Job (#10324) 2019-09-11 10:51:32 -07:00
Kirk Munro 139cd942b2 Transition ActionPreference.Suspend enumeration value into a non-supported, reserved state, and remove restriction on using ActionPreference.Ignore in preference variables (#10317) 2019-09-07 23:45:36 +05:00
Kirk Munro cc0fed479a Add APIs for breakpoint management in runspaces and enable attach to process without BreakAll for PSES (#10338) 2019-09-05 11:30:25 -07:00
Paul Higinbotham cfdbd71888 Fix for ForEach-Object -Parallel performance problem with many runspaces (#10455) 2019-09-05 11:27:20 -07:00
Dongbo Wang 5069c7d6a6 Support ternary operator in PowerShell language (#10367) 2019-09-04 13:22:33 -07:00
Kirk Munro eb81fb749a Mark -parallel and -throttlelimit reserved for foreach and switch statements (#10328) 2019-08-15 14:41:41 -07:00
Paul Higinbotham fbfc57a00c Implement ForEach-Object -Parallel feature (#10229) 2019-08-13 13:40:58 -07:00
Aditya Patwardhan 7dfcff9287 Merged PR 9168: Disable Enter-PSHostProcess cmdlet when system in lock down mode
This is based on an issue, where Enter-PSHostProcess on a locked down (WDAC enforced) machine allows any admin to connect to any another local hosted PowerShell process and execute commands as that user. This amounts to privilege escalation on the policy locked down machine and something we want to prevent.

Fix is to check for system lock down and disable Enter-PSHostProcess cmdlet with an error message.
2019-07-16 00:49:24 +00:00
Ilya 18ff2b6b1d
Cleanup workflow - remove PSProxyJob (#10083) 2019-07-12 07:56:27 +05:00
Ilya 5d98b901be
Cleanup workflow code (#9638)
* Remove WorkFlowInfo type

* Remove condition for UseSharedProcess

* Remove PSWorkflowJob condition

* Remove workflow from ValidateSet

* Remove workflow from CommandTypes enum

* Remove workflow from EventManager

* Remove workflow from Get-Help

* Remove WorkflowFileExtension ".xaml" from ModuleIntrinsics

* Remove WorkflowFileExtension ".xaml" from ModuleCmdletBase

* Remove workflow from PSModuleInfo

* Remove workflow from CustomShellCommands

* Remove workflow from InitialSessionStateProvider

* Remove WriteWorkflowDebugNotSupportedError()

* Remove unneeded resource strings from Module.cs

* Remove xaml from valid extension list
2019-07-07 01:03:03 +05:00
Steve Lee 68ae58eca3 Fix use of unicode ellipsis in xml (#9589) 2019-05-14 11:58:27 +05:00
Steve Lee a96b4c0404 Update use of "PowerShell Core" to just "PowerShell" (#9513) 2019-05-10 15:34:27 -07:00
Ilya 3947c9d93f
Improve error message in FileSystemProvider (#9551) 2019-05-08 08:25:24 +05:00
Steve Lee 3bfca6d0fa Update use of Windows PowerShell to just PowerShell (#9508) 2019-05-03 15:38:06 +05:00
Paul Higinbotham 9ea60587fc Add psremoting enable/disable cmdlet warning messages (#9203)
Adds warning messages to the Enable-PSRemoting and Disable-PSRemoting cmdlets that informs the user that the cmdlets only affect PSCore6 remoting endpoint configurations and not Windows PowerShell configurations.

PR Context
As documented, Enable-PSRemoting and Disable-PSRemoting affects all PowerShell remoting on a Windows system, and Windows users will likely expect the cmdlets to continue working this way in PSCore6. However, these cmdlets currently affect only PSCore6 remoting endpoints when run in PSCore6 and have no effect on Windows remoting endpoints.
2019-03-25 09:39:15 -07:00
Dongbo Wang 24d3152f00 Make Start-Job throw terminating exception when -RunAs32 is specified in 64-bit pwsh (#9143) 2019-03-18 10:23:29 -07:00
Dongbo Wang cdb28a1067 Make 'Start-Job' throw terminating error when PowerShell is being hosted (#9128) 2019-03-13 17:57:42 -07:00
pougetat a79ed1ef0f Make New-ModuleManifest consistent with Update-ModuleManifest (#9104) 2019-03-13 12:01:42 -07:00
Tyler James Leonhardt 23eccfd641 [feature] Add -CustomPipeName to pwsh and Enter-PSHostProcess (#8889)
This allows a user to start PowerShell up with the name of the named pipe that is used for cross process communication (I.e. Enter-PSHostProcess).
2019-02-22 23:40:03 +05:00
Travis Plunk 57aeca428e
Port Security bypass fixes from 6.1.3 (#8915) 2019-02-21 13:44:08 -08:00
Steve Lee 5ece96a37f Don't use Win32 native APIs on non-Windows for crypto of secure string over remoting (#8746)
Remoting relies on Windows native crypto APIs to pass a secure string.  Of course these APIs don't work on non-Windows.  However, the remoting code does not expect this to fail so ends up in a hang waiting for an event that never happens.

Have not figured out how to return an error to the user in the case `Get-Credential` is called within a PSSession.  Currently it just quietly closes the remote connection.  @PaulHigin can you give a pointer to where this code would exist?  Debugging the current code, it has a bunch of error handlers which just result in the pssession being closed and not sure where throwing is appropriate.

Fix https://github.com/PowerShell/PowerShell/issues/8723

## PR Context  

Fix is to provide implementations of the Win32 native pinvoke apis that throw an exception.  The reason to do it this way is that there's a bunch of code that calls some of the APIs of the wrapper .Net class to setup structures that eventually get passed to the win32 api.  Throwing in the managed class causes other things to fail early that should work on non-Windows.
2019-02-07 15:36:13 -08:00
Steve Lee 7e2cd7954f Add the experimental feature for creating 'Temp:\' drive when FileSystemProvider initializes (#8696)
Adds Experimental Feature called `PSTempDrive` that, if enabled, creates a PSDrive called `Temp:` that maps to `[System.IO.Path]::GetTempPath()`.
2019-01-23 13:53:04 -08:00
Mathias R. Jessen 59a3696f70 Allow user-specified underlying type for enums (#8329)
Fix #8028 

This change adds support for specifying the underlying type for an enum:

```powershell
enum MyEnum : long 
{
  A = 0x0FFFFFFFFFFFFFFF
  B
}
# or
enum MyByte : byte 
{
  A = 0x01
  B = 0x02
  C = 0x03
  D
}
```
2019-01-17 14:22:10 -08:00
Dongbo Wang c2dfae8ccb Fix 'FixupFileName' to not load resolved assembly during module discovery (#8634) 2019-01-15 16:22:25 -08:00
Steve Lee b87cd1c0a3 Add support to show suggestions on CommandNotFound exception (#8458)
* support fuzzy matching with get-command and on CommandNotFound exception, show suggestion
* fix CodeFactor issues
* change algorithm to use Damerau-Levenshtein Distance which is more useful in finding close matches
2019-01-10 13:35:30 -08:00
Luke Jeremy 56fc426f8b Add -UseMinimalHeader to Start-Transcript to minimize transcript header (#8402) 2018-12-20 11:12:14 -08: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
Steve Lee 52aef57ab6 Add Enable-ExperimentalFeature and Disable-ExperimentalFeature cmdlets (#8318)
[breaking change]
Major changes are as follows:
- Add `Enable-ExperimentalFeature` and `Disable-ExperimentalFeature` cmdlets.
- Remove `-ListAvailable` from `Get-ExperimentalFeature`.
- Add `ArgumentCompleter` for `Get-ExperimentalFeature` cmdlet.
- Refactor some existing Experimental Feature tests.
- Make `ConfigScope` public and renamed `SystemWide` to `AllUsers`. Also update experimental feature code to prefer the current user config over the all user config.
2018-12-05 12:20:58 -08:00
Paul Higinbotham 06571637e4 Add SkipCA and SkipCN check requirement to WinRM/OMI HTTPS connection (#8279) 2018-11-27 16:16:00 -08:00
Ilya e2b5aaca20
Remove old 'customPSSnapInType' parameter from PSSnapInInfo() (#8333) 2018-11-26 11:21:46 +05:00
Travis Plunk 79f21b41de
Consolidation of all Windows PowerShell work ported to PSCore6 (#8257)
Consolidation of all Windows PowerShell work ported to PSCore6

* Added ps1 file import restriction.  Refactored InvokeLanguageModeTestingSupportCmdlet to HelpersSecurity module
* JEA loop back fix.  Debugger running commands in CL mode.
* Support for new AMSI codes.  Changed to use AMSI buffer API.  Unhandled exception fix.
* Fixes for module bugs while running in ConstrainedLanguage mode
* Untrusted input tracking work
* Configuration keyword bug fix, PSRP protocol version check for reconstruct reconnect, Sharing InitialSessionState in runspace pool.
* Restricted remote session in UMCI, Applocker detection collision, Help command exposing functions, Null reference exception fix.
* Added mitigation for debugger function exposure
2018-11-13 16:16:29 -08:00