Commit graph

6384 commits

Author SHA1 Message Date
Staffan Gustafsson 81313743df Improving performance of LanguagePrimitives.TryConvertTo. (#7418)
Before the fix the TryConvertTo() is implemented in terms of Convert(), but with wrapping exception handling. This is costly performance wise. By inlining the implementation of ConvertTo(), and getting access to the FigureConversion output we can determine upfront on at least some occations that a conversion is not available.
2018-08-03 09:18:05 +05:00
Steve Lee f8b3abaac7 Add support for passing files and markdown directly to Show-Markdown (#7354)
* add support for -Path/-LiteralPath and piping strings directly to Show-Markdown

* update tests to set vt100 support
2018-08-02 15:49:38 -07:00
Christoph Bergmeister [MVP] 5717a5dffc Add xunit project to PowerShell.sln and make it runable from within VisualStudio (#7254)
* add csproj ref to sln

* Remove Microsoft.NET.Test.Sdk NuGet reference. The xunit.runner.visualstudio package is now sufficient for running tests in VS in the latest version (15.7.5)

* use RTM versions of XUnit 2.4.0 that got published today

* Update XUnit in hosting project as well to newer release
2018-08-02 11:51:04 -07:00
Dongbo Wang 73b6d810bd
Make logging tests for macOS pending (#7433) 2018-08-01 16:49:39 -07:00
Jianyun 344878dcbb Set the cursor to the place where a user hits tab key (#7299)
* Set the cursor to the place where a user hits tab key
2018-08-01 13:31:49 -07:00
Ilya 5d03e1653a
Remove empty xml comment lines (#7401) 2018-08-01 10:39:13 +05:00
Sergey Vasin 740d059d51 Change parameters order in Get-Help and help in order to get first -Full and then -Functionality when using Get-Help -Fu<tab> and help -Fu<tab>. (#7370) 2018-07-31 11:13:18 +05:00
Christoph Bergmeister [MVP] 779957b12a Update WCF and NJsonSchema NuGet packages to latest released patch version (#7411) 2018-07-31 09:53:38 +05:00
Sergey Vasin 58ac08c60a Use -HaveCount instead of -Be in Where-Object.Tests.ps1. (#7379) 2018-07-31 08:51:42 +05:00
Sergey Vasin fcc519bb08 Fix parameter name in the Get-Variable cmdlet error message. (#7384)
Before the fix when using Get-Variable or Get-Alias cmdlets with the -Scope parameter with wrong value, the error message refers to 'scopeID' parameter instead of 'Scope'.
2018-07-31 08:50:41 +05:00
Aleksandar Nikolić ca7f103a15 Fix casing of GitHub in best-practice.md (#7392)
Fix Github to GitHub.
2018-07-30 10:36:41 -07:00
Sergey Vasin da6d2647ac Use -BeExactly and -HaveCount instead of -Be in TabCompletion.Tests.ps1. (#7380) 2018-07-30 10:32:52 +05:00
Sergey Vasin 9e30419501 Use -BeExactly and -HaveCount instead of -Be in BugFix.Tests.ps1. (#7386) 2018-07-30 08:17:28 +05:00
Aleksandar Nikolić 27df6dcb32 Fix a typo in issue-management.md (#7393) 2018-07-27 17:44:59 -07:00
Aleksandar Nikolić a5f9b50319 Fix typos in docs/maintainers/README.md (#7390) 2018-07-27 17:29:07 -07: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
Dan Thompson e7c315b65c Start-DevPowerShell: add -Configuration and handle -ArgumentList more properly (#7300)
- Allow specifying the configuration, rather than the `bin` folder.
- Do not attempt to pass null/empty `ArgumentList` to `Start-Process`.
2018-07-26 10:30:05 -07:00
Ilya d97c9e701b Bulk update format for files in Management folder with codeformatter (#7346) 2018-07-26 10:14:09 -07:00
Dongbo Wang 63430e91b9
Set 'PowerShellVersion' to 3.0 for built-in modules to make Windows PowerShell work when starting from PSCore (#7365) 2018-07-26 10:10:20 -07:00
Steve Lee b767d5cacd Fix IsHardLink() to return false instead of throwing exception when unable to determine (#7355) 2018-07-26 10:08:38 -07:00
Paul Higinbotham 20f7577548 Fix ThreadJob tests so that they will run more reliably (#7360) 2018-07-26 10:02:05 -07:00
Dongbo Wang 41111a15e6
Update 'Utils.IsComObject' to use 'Marshal.IsComObject' since CAS is no longer supported in .NET Core (#7344)
A comment from the existing `Utils.IsComObject` mentions that: "We can't use System.Runtime.InteropServices.Marshal.IsComObject(obj) since it doesn't work in partial trust."

Partial trust is a concept of Code Access Security (CAS)/Security-Transparent. CAS and Security-Transparent are no longer supported in .NET Core, so we should use `Marshal.IsComObject` instead.
2018-07-26 09:59:07 -07:00
Dan Travison 1583318d72 Correct the comment for 'WSManReceiveDataResult.Unmarshal'. (#7364) 2018-07-25 16:37:10 -07:00
Steve Lee 1244278e7e [package] (#7345)
enable `pwsh-preview` to work on Windows
2018-07-25 13:32:10 -07:00
Dan Travison 936626b7e8 Update PowerShell to reference 'psrp.1.4.5-0' on Unix build (#7350) 2018-07-25 10:04:00 -07:00
Ilya e3854815ab Cleanup: replace 'Utils.FileExists()/DirectoryExists()/ItemExists()' with .NET methods (#7129) 2018-07-25 10:02:09 -07:00
Dongbo Wang 87d8fc969c
Fix sequence point update for switch/if/for/while/do-while/do-until statements (#7305)
- Make switch-statement report correct error position when it fails to evaluate the condition.
- Make for-statement report correct error position when it fails to evaluate the initializer.
- For the condition of `if/for/while/do-while/do-until` statements, the sequence point update is either duplicate in some cases (for `if/for/while`) which causes debugger to stop at the condition twice  before moving forward, or missing (for `do-while/do-until`) which causes debugger to skip the condition. They are fixed.
2018-07-25 09:56:32 -07:00
Joshua Cooper 439f97c533 Update Docker link to PowerShell-Docker (#7351) 2018-07-25 12:28:37 +05:00
Adam Gauthier e34554c3ca Ignore Newtonsoft.Json metadata properties in ConvertFrom-Json (#7308)
Some values are not converted from json to PSCustomObject, because Newtonsoft.Json reads them and thinks they are metadata properties only useful for deserialization. This change makes Newtonsoft.Json "ignore" those properties so they are converted correctly from json to PSCustomObject.
2018-07-25 08:56:49 +05:00
Steve Lee f5a7d79175 Add support for parsing Link Header with variable whitespace (#7322)
Fix is to change the regex to allow for variable or no whitespace and associated tests to handle these two cases.
2018-07-24 10:56:00 +05:00
Travis Plunk 80d2af8934
Cleanup Docker files (#7328)
* update docker read me to point to new repo
* remove unused files
2018-07-23 15:19:58 -07:00
Dongbo Wang 5c11f09706
Add maintainer's best practice document and update maintainer list (#7311) 2018-07-20 21:31:21 -07:00
Ilya e9d5f68ba5 Format Utility csproj with updated codeformatter (#7263)
Related #4708.

Format Microsoft.PowerShell.Commands.Utility.csproj by codeformatter with default options.

The codeformatter is used that I compiled with newest Roslyn packages (version 2.8.2).
2018-07-20 18:51:13 -07:00
Dan Travison 6febd1f883 Update Build script owners (#7321) 2018-07-20 12:32:49 -07:00
Aditya Patwardhan ed4a454ac4 Make MUSL NuGet package optional (#7316) 2018-07-20 11:08:25 -07:00
Greg Zimmerman d9c570a90d Fix macOS launcher app to allow release and preview versions. (#7306)
Fixes #7074. This PR allows concurrent versions of the macOS launcher app to exist. The application name will be either PowerShell or PowerShell-preview. It is now dynamically built and removed post fpm to avoid post build conflicts, see #5262 .
2018-07-20 10:53:09 -07:00
Travis Plunk fd4494f224 Add 'Snapcraft' to spelling dictionary (#7318) 2018-07-19 19:55:04 -07:00
Travis Plunk 90dcce6c40 Merge branch 'release-v6.1.0-preview.4' into master 2018-07-19 16:38:26 -07:00
Dongbo Wang 08e3955231 Merged PR 3912: Update package versions for the new release 2018-07-19 22:15:44 +00:00
Travis Plunk c74be0ba40 Merged PR 3869: initial draft of changelog
initial draft of changelog
2018-07-19 21:09:30 +00:00
Ilya a3786158ca
Fix docs comments in utility folder (#7192) 2018-07-17 10:07:16 +05:00
Steve Lee 63041b4aec Update Enable-PSRemoting so configuration name for Preview releases (#7202)
The intent was to have the version of the PSSessionConfiguration name not include the `v` for the version string.  Also, Preview releases should standardize on `PowerShell.6-Preview` instead of clobbering `PowerShell.6` so that stable and preview can co-exist side-by-side.

Need to verify on Win10 IoT if `Install-PowerShellRemoting.ps1` is still needed anymore as it may be possible to run `pwsh -c enable-psremoting` from within Windows PowerShell Core removing the need for that script which duplicates `Enable-PSRemoting` capability.

Update: Not able to get the current master build working on Win10 IoT, getting `Invalid access to memory` error.  Will have to investigate this separately from this PR and keep `Install-PowerShellRemoting.ps1` for now.

Fix https://github.com/PowerShell/PowerShell/issues/7119
2018-07-16 19:40:46 -07:00
Robert Holt e857135d3c 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 19:40:46 -07:00
Steve Lee 0a2f9c8821 Update Enable-PSRemoting so configuration name for Preview releases (#7202)
The intent was to have the version of the PSSessionConfiguration name not include the `v` for the version string.  Also, Preview releases should standardize on `PowerShell.6-Preview` instead of clobbering `PowerShell.6` so that stable and preview can co-exist side-by-side.

Need to verify on Win10 IoT if `Install-PowerShellRemoting.ps1` is still needed anymore as it may be possible to run `pwsh -c enable-psremoting` from within Windows PowerShell Core removing the need for that script which duplicates `Enable-PSRemoting` capability.

Update: Not able to get the current master build working on Win10 IoT, getting `Invalid access to memory` error.  Will have to investigate this separately from this PR and keep `Install-PowerShellRemoting.ps1` for now.

Fix https://github.com/PowerShell/PowerShell/issues/7119
2018-07-16 19:35:48 -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
Steve Lee da7b5216b5 Update remote prompt when using ssh to show username if different (#7191)
Currently, the remote prompt only shows the remote computer name:

> [computer] PS:\foo>

With this change, if you use PSRP over SSH and you specified a different username, it shows whom you logged in as:

> [user@computer] PS:\foo>

The fix is when the remote prompt is being created to check if using SSH if so, check if the current user is different than the specified user and specified.  If different, use `[user@computer]`, otherwise fallback to default `[computer]` prompt.

Fix https://github.com/PowerShell/PowerShell/issues/7156
2018-07-16 11:45:32 -07:00
Dongbo Wang ee0a643f19
Fix the encoding of 'PowerShell.sln' to be utf-8 (#7289) 2018-07-13 20:43:26 -07:00
Aditya Patwardhan 7ba4d65a42 Fix the file 'PowerShell.sln' that was corrupted by accident (#7288) 2018-07-13 18:11:55 -07:00
Dongbo Wang 6f3e9d0881
Added Markdown rendering cmdlets (#6926)
- `ConvertFrom-Markdown` is used for converting a markdown document or string to a MarkdownInfo object. It can optionally return an HTML or a VT100 encoded string in addition to an AST of the markdown document.
- `Show-Markdown` is used to either display the VT100 encoded string on the console or redirect the HTML string to the browser.
- `Set/Get-MarkdownOption` cmdlets are used to view or set markdown rendering options.
2018-07-13 13:56:17 -07:00
Aditya Patwardhan ab07b85f01
Merge pull request #7284 from daxian-dbw/removeVB
Remove the 'VisualBasic' support from Add-Type
2018-07-13 13:48:50 -07:00