Commit graph

64 commits

Author SHA1 Message Date
MartinGC94 965dc8f40f
Fix tab completion within the script block specified for the ValidateScriptAttribute. (#14550) 2021-11-09 18:26:14 -08:00
Maksim Ivanyuk 674ef888a2
Add -HttpVersion parameter to web cmdlets (#15853) 2021-11-02 16:53:36 -07:00
Steve Lee cced56d75a
Make PS-Committee reviewed experimental features stable (#15864) 2021-08-09 14:01:57 -07:00
Ilya 0f3bc73d9a
Implement a completion for View parameter of format cmdlets (#14513) 2021-07-13 17:32:48 +00:00
MartinGC94 77054ff586
Fix splatting being treated as positional parameter (#14623) 2021-06-15 16:56:14 -07:00
MartinGC94 2fc3826dd3
Add completions for comment-based help keywords (#15337) 2021-05-25 13:36:53 -07:00
MartinGC94 5d8336adf5
Fix tab completion for un-localized about topics (#15265) 2021-05-05 11:24:40 -07:00
MartinGC94 55d12ee76c
Add completion for Requires statements (#14596) 2021-04-14 10:26:48 -07:00
MartinGC94 e26d7084e2
Improve completion of parameters for attributes (#14525) 2021-01-14 09:30:15 +05:00
Aditya Patwardhan cb8165eeef
Move PSNullConditionalOperators feature out of experimental (#13529) 2020-08-27 10:11:01 -07:00
Travis Plunk 6583d501b5
Fix a test failure (#12636) 2020-05-12 14:26:22 -07:00
xtqqczze f4382202ae
Use correct casing for cmdlet name and cmdlet parameter name in *.ps1 files (#12584) 2020-05-07 17:00:30 +05:00
Steve Lee b7cb335f03
Update copyright notice to latest guidance (#12190) 2020-03-24 11:08:37 -07:00
xtqqczze 2014ce66c1
Set StrictMode version 3.0 (#11563) 2020-02-03 09:44:10 -08:00
xtqqczze e0d2e2aade Correct case of $PSHOME special variable 2020-01-13 19:35:33 +00:00
xtqqczze 225164037f Correct case of $PID special variable 2020-01-13 19:34:38 +00:00
xtqqczze b5326a8488 Correct case of $Host special variable 2020-01-13 19:34:10 +00:00
xtqqczze 743983390e Update pester syntax to v4 (#11544)
* Capitalize 'Should' command and fix whitespace

```powershell
$_ -ireplace '\s?\|\s?should\b',' | Should'
```

* Capitalise and apply hyphen to 'Not' parameter

```powershell
$_ -ireplace '(\| Should) not\b','$1 -Not'
```

* Capitalise and apply hyphen to 'Be' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?) -?be\b','$1 -Be'
```

* Capitalise and apply hyphen to 'BeExactly' parameter

$_ -ireplace '(\| Should(?: -Not)?) -?beexactly\b','$1 -BeExactly'

* Capitalise and apply hyphen to 'BeGreaterThan' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?) -?begreaterthan\b','$1 -BeGreaterThan'
```

* Use 'BeTrue' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?) -Be\s\$?true\b','$1 -BeTrue'
```

* Use 'BeFalse' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?) -Be\s\$?false\b','$1 -BeFalse'
```

* Capitalise and apply hyphen to 'Match' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?)\s-?match\b','$1 -Match'
```

* Capitalise and apply hyphen to 'Throw' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?)\s-?throw\b','$1 -Throw'
```

* Capitalise and apply hyphen to 'BeNullOrEmpty' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?)\s-?benullorempty\b','$1 -BeNullOrEmpty'
```

* Capitalise 'Because' parameter

```powershell
$_ -ireplace '\s-because\b',' -Because'
```

* Fix 'BeNullOrEmpty'
2020-01-11 20:41:59 +05:00
Aditya Patwardhan 2dbb5717ce Make null member access tests as string to avoid parsing errors (#11385)
* Make null member access tests as string to avoid parsing errors

* Add PSNullConditionalOperators feature to testmetadata.json

* Add Parsing tests to be skipped

* Add tabcompletion tests
2019-12-21 00:14:07 +00:00
M1kep 570ba43a24 Allow CompleteInput to return results from ArgumentCompleter when AST or Script has matching function definition (#10574) 2019-12-02 10:51:13 -08:00
Steve Lee 2e553038c5 Allow pwsh to inherit $env:PSModulePath and enable powershell.exe to start correctly (#11057) 2019-11-15 17:29:04 -08:00
Aditya Patwardhan 2579c00a20 Support null-conditional operators ?. and ?[] in PowerShell language (#10960) 2019-11-15 16:39:53 -08:00
Steve Lee df811929eb Fix tab completion for parameters so that it shows common parameters as available (#10850) 2019-10-31 13:09:37 -07:00
Steve Lee f48a28eff2 Change TabExpansion2 to not require -CursorColumn and treat as $InputScript.Length (#10849)
* FEATURE: Change TabExpansion2 to not require `-CursorColumn` and treat as `$InputScript.Length`

* address Jason's feedback
2019-10-30 20:45:28 +00:00
Steve Lee 0842fe8b8d Enable tab completion for variable assignment that is enum (#10646) 2019-10-14 09:53:11 -07:00
Ilya 18ff2b6b1d
Cleanup workflow - remove PSProxyJob (#10083) 2019-07-12 07:56:27 +05:00
Steve Lee 981c990d74 Make UseAbbreviationExpansion and TempDrive official features (#9872) 2019-06-13 13:05:37 -07:00
Steve Lee 29e21470d9 Port PowerShell to .NET Core 3.0 (#9597) 2019-05-21 13:43:51 +08:00
Tyler James Leonhardt 9140e421ec Add wildcard back to end of tab completion command lookup (#9383)
Re-add wildcard when searching AST + Missed test case.

## PR Context

In #8109, we removed the line that added a wildcard to the end of the command that was used to match commands in the script AST. This readds that line closer to where it is used.
2019-04-18 11:42:49 -07:00
Travis Plunk 185f20e3bd
Add tests for command globbing (#9180)
Add tests for command globbing
  - Also, add `-noprofile` to places where `pwsh` is launched so they don't fail locally.
2019-03-21 13:49:57 -07:00
James Truher [MSFT] e605fbdea7 Fix tab completion test to handle multiple matches (#8891) 2019-03-11 14:51:22 -07:00
Kirk Munro 45aba2acb5 Add 5 'InvokeAsync' overloads and 'StopAsync' to the 'PowerShell' type (#8056) 2019-03-06 10:06:11 -08:00
Steve Lee 71e58f9439 Add the experimental feature 'PSUseAbbreviationExpansion' to support tab completion on abbreviated command names (#8109) 2019-01-10 16:11:43 -08:00
Kirk Munro 1729a682ee Make S.M.A.PowerShell.GetSteppablePipeline method public (#8055)
* make GetSteppablePipeline method public
* updated PowerShell member count
2019-01-09 15:31:09 -08:00
Aditya Patwardhan 8c3de33ae1
Update help content for TabCompletion tests only if it does not exist (#8355) 2018-11-29 16:16:36 -08:00
Paul Higinbotham d4bf5c87bc Fix tests running in Azure DevOps (#8220) 2018-11-09 15:11:02 -08:00
Travis Plunk c6910a12fa Fix conflict with Get-AdlStoreChildItem from az module in tab completion tests (#8167) 2018-11-01 12:03:03 -07:00
Steve Lee b27380dc51 Enable case-insensitive tab completion for files and folders on case-sensitive filesystem (#8128) 2018-10-28 09:48:49 +05:00
Patrick Meinecke 57bf508fec Fix static method invocation type inference (#8018)
Fixes type inference for static method invocations (e.g. [powershell]::Create()).
2018-10-23 16:58:31 +05:00
Ilya 450d884668
Add test for $error[0] tab completion (#7924) 2018-10-03 12:34:21 +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
Sergey Vasin da6d2647ac Use -BeExactly and -HaveCount instead of -Be in TabCompletion.Tests.ps1. (#7380) 2018-07-30 10:32:52 +05:00
Steve Lee 5f47fc0e8c Fix tab expansion for Get-Process on macOS (#7176)
* fix tab exapnsion for get-process on macOS

* add comment to address PR feedback
2018-06-27 12:48:42 -07:00
Klaudia Algiz 2df9aac811 Convert ShouldBeErrorId to Should -Throw -ErrorId in PowerShell tests (#6682)
Convert ShouldBeErrorId to Should -Throw -ErrorId in PowerShell tests.
Get rid of try { } catch { } formula to assert that errors were thrown.
Small fixes in tests to obey the new Pester -Parameter syntax.
2018-05-17 14:42:04 -07:00
Ilya 84344cbb32 Update PowerShell to build with .NET Core SDK 2.1.300-rc1-008662 (#6718)
* Build Update
- Change `TargetFramework` to `netcoreapp2.1` and removed unnecessary `RuntimeFrameworkVersion` from `PowerShell.Common.props`
- Update dotnet SDK to 2.1.300-rc1-008662
- Update `TypeGen` target in `Build.psm1` to work with 2.1
- Rename macOS runtime to `osx-x64` as the old build logic expects 10.12 and breaks running on 10.13 system.
- Remove `PackageReference` to `System.Memory` as it's part of dotnetcore 2.1
- Update search for `crossgen` executable to find the matching version

* Test Update
- Update test tools `WebListener` to latest `asp.net core`
- Marked `AuthHeader Redirect` tests as `Pending` due to change in CoreFX
2018-05-02 16:58:39 -07:00
Aditya Patwardhan 610ae1a63f Update 'Update-Help' to save help content in user scope by default (#6352)
Add the parameter `-Scope` to `Update-Help`, which takes `AllUsers` or `CurrentUser`. The default value is `CurrentUser`.
2018-04-02 15:32:55 -07:00
Christoph Bergmeister e86fea6acd Upgrade tests in test\powershell\Host folder to PesterV4 syntax (#6250) 2018-03-23 10:48:26 -07:00
kwkam 5f202d676f Add 'NullReference' checks to two code paths related to 'PseudoParameterBinder' (#5738)
1. Add a null check in the tab completion code on the binding result returned from `PseudoParameterBinder`;
2. Add a null check in `CommandDiscovery.LookupCommandProcessor` on the `CommandInfo` object returned from the method `LookupCommandInfo`.
2018-03-16 09:10:06 -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
Aditya Patwardhan 381134ba59 Updated csproj to use the latest help package (#5454) 2017-11-15 16:29:04 -08:00