Commit Graph
79 Commits
Author SHA1 Message Date
Patrick Meinecke c5f2446e69 Suppress false positive PSScriptAnalyzer warnings in tests and build scripts (#25864) 2025-08-19 11:51:38 +05:00
(Havox) 1b786d2d89 Add support for thousands separators in [bigint] casting (#25396) 2025-05-08 17:10:33 +05:00
MartinGC94 0c96975d1e Exclude outvariable assignments within the same CommandAst when inferring variables (#25224) 2025-03-26 18:00:46 +00:00
MartinGC94 dea739cf99 Fix infinite loop in variable type inference (#25206) 2025-03-26 07:53:08 +05:00
MartinGC94 0ca17fdacd Fix type inference of parameters in classic functions (#25172) 2025-03-18 13:23:49 +05:00
MartinGC94 1edd258e3b Improve assignment type inference (#21143) 2025-03-18 09:48:11 +05:00
MartinGC94 becdd61b3c Improve variable type inference (#19830) 2025-03-13 10:04:02 +00:00
MartinGC94 33ed509ca4 Add type inference for functions without OutputType attribute and anonymous functions (#21127) 2025-02-28 17:48:59 +00:00
MartinGC94 6fbd8ba1dd Handle type inference for redirected commands (#21131) 2025-02-28 04:20:25 +00:00
MartinGC94 f47b14e7ff Improve the type inference for binary expressions (#25030) 2025-02-20 10:39:29 +05:00
MartinGC94 fd85f6c35a Use types from both sides of the pipeline chain for the type inference (#25031) 2025-02-18 05:44:28 +00:00
MartinGC94 57dbde625f Update Named and Statement block type inference to not consider AssignmentStatements and Increment/decrement operators as part of their output (#21137) 2024-12-29 17:29:03 +05:00
Jordan Borean ab43c19390 Improve .NET overload definition of generic methods (#21326) 2024-07-01 14:03:01 -07:00
MartinGC94 aa97c515c8 Fall back to type inference when hashtable key value cannot be retrieved from safe expression (#21184) 2024-03-04 15:55:23 -08:00
MartinGC94 f093f538fa Fix variable type inference precedence (#18691) 2023-06-12 10:38:17 -07:00
MartinGC94 25651ef6e9 Fix a crash in the type inference code (#19400) 2023-03-23 14:40:50 -07:00
MartinGC94 39d48f9c62 Infer external application output as strings (#19193) 2023-03-14 11:24:43 -07:00
MartinGC94 0ae521b7b5 Improve type inference for Get-Random (#18972) 2023-03-13 15:44:38 -07:00
James Truher [MSFT] 5f3100cd95 Change test so output does not include newline. (#19026) 2023-01-25 18:02:20 -08:00
MartinGC94 8f7c980ca3 Fix type inference for all scope vars (#18758) 2022-12-20 15:38:25 +05:00
Dongbo Wang ae3c3169ee Fix SuspiciousContentChecker.Match to detect a pre-defined string when the text starts with it (#18693) 2022-12-01 22:26:43 -08:00
MartinGC94 b5ffd043c5 Improve type inference of hashtable keys (#17907) 2022-11-07 17:10:03 -08:00
MartinGC94 ab7f206271 Fix type inference error for empty return statements (#18351) 2022-10-24 14:39:34 -07:00
MartinGC94 15dcf634e2 Improve enumeration of inferred types in pipeline (#17799) 2022-08-09 10:37:56 -07:00
MartinGC94 3d4e294262 Improve type inference for $_ (#17716) 2022-07-25 11:27:23 -07:00
MartinGC94 5ccbb97ae3 Fix type inference for ICollection (#17752) 2022-07-25 11:15:19 -07:00
github-actions[bot] 17b23e3ebc Update .NET SDK version from 7.0.100-preview.5.22307.18 to 7.0.100-preview.6.22352.1 (#17634) 2022-07-06 17:35:59 -07:00
Eugene Samoylov 735096bcc1 Show optional parameters as such when displaying method definition and overloads (#13799)
* Extend `GetMethodInfoOverloadDefinition` to show optional parameters as such (#13728)

* Fix CodeFactor style issue

* Fix review issues

* Add tests for TabExpansion2 `ToolTip`

* Fix tooltip string splitting

* Fix tests

* Bring back the namespace
2022-06-27 12:21:25 -07:00
MartinGC94 4f6e574820 Improve type inference and completions (#16963) 2022-06-13 10:04:35 -07:00
MartinGC94 e7f705adef Add type inference support for generic methods with type parameters (#16951) 2022-05-27 11:17:53 -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
hammy3502 3eca7c019e Adds a .ResolvedTarget Property to File-System Items to Reflect a Symlink's Target as FileSystemInfo (#16490) 2022-01-21 09:23:11 +05:00
github-actions[bot] d33b223674 Update .NET SDK version from 6.0.100-preview.6.21355.2 to 6.0.100-rc.1.21426.1 (#15648) 2021-08-26 13:07:43 -07:00
Ilya 5ad8a5916f Add support for some .NET intrinsic type converters (#12580) 2020-07-08 14:32:58 -07:00
xtqqczze d98f131c5a Remove phrase 'All rights reserved' from Microsoft copyright statements (#12722)
# PR Summary

<!-- Summarize your PR between here and the checklist. -->

## PR Context

follow-up #12190

## PR Checklist

- [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
    - Use the present tense and imperative mood when describing your changes
- [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [ ] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress).
    - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready.
- **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)**
    - [x] None
    - **OR**
    - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md)
        - [ ] Experimental feature name(s): <!-- Experimental feature name(s) here -->
- **User-facing changes**
    - [x] Not Applicable
    - **OR**
    - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
        - [ ] Issue filed: <!-- Number/link of that issue here -->
- **Testing - New and feature**
    - [x] N/A or can only be tested interactively
    - **OR**
    - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting)
- **Tooling**
    - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
    - **OR**
    - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include:
        - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host).
        - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
        - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions).
        - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors).
2020-05-20 12:02:38 +00:00
Tyler James Leonhardt 1bf5cc9317 Copy the CommandInfo property in Command.Clone() (#12301) 2020-05-11 13:17:43 -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
Dongbo Wang c0c17ded03 Do not wrap return result to PSObject when converting ScriptBlock to delegate (#10619)
This is a breaking change for the delegate types with the object return type:

Before this change, the returned object will always be an PSObject instance.
After this change, the returned object is the underlying object, which could still be an PSObject if that's what the script actually returns.
2020-03-30 21:46:12 +05:00
Steve Lee b7cb335f03 Update copyright notice to latest guidance (#12190) 2020-03-24 11:08:37 -07:00
xtqqczze 920b671fb4 Unify pester test syntax for the arguments of -BeOfType (#11558) 2020-01-24 11:00:37 -08: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
xtqqczze 70d9ed4d55 Remove Unicode BOM from text files (#11546) 2020-01-11 12:15:34 +05:00
Ilya 99cf9fd859 Re-balance CI tests (#11420) 2020-01-05 13:01:42 +05:00
Ilya b221c2afa2 Correct pwsh run (#11486) 2020-01-05 12:17:41 +05:00
xtqqczze 7a7365279c Avoid variable names that conflict with automatic variables (#11392) 2019-12-20 12:09:03 -08:00
Kirk Munro 8b9f4124ce Add support to ActionPreference.Break to break into debugger (#8205) 2019-08-23 10:34:10 -07:00
Aditya Patwardhan ade85b4faa Multiple test fixes and improved logging for fragile tests (#9569) 2019-05-10 10:56:12 -07:00
xtqqczze a702f68974 Ensure Wait-UntilTrue returns $true in Pester tests (#9458) 2019-05-01 17:03:43 -07:00
Dongbo Wang e299a30128 Fixing test run crash by not passing script block to the callback (#9298) 2019-04-08 11:06:27 -07:00
Patrick Meinecke b4ebf63335 Improve type inference of array literals and foreach statement variables (#8100)
Improve type inference for foreach statement variables by:

Inferring strongly typed arrays from explicit array and array literal expressions when elements are of the same inferred type

Fix detection of foreach variable declaration. The previous logic was to check if the variable expression's start offset was after the end offset of the foreach statement, which will never be true in the body

Improve inference of what type the "Condition" of a foreach statement will enumerate as
2019-03-19 13:36:27 -07:00