Commit graph

3859 commits

Author SHA1 Message Date
xtqqczze 87b2581dd2
Change SwitchParameters from fields to properties (#13291) 2020-08-06 15:29:17 -07:00
dependabot-preview[bot] d4e047ce45
Bump PSReadLine from 2.0.2 to 2.0.4 (#13240) 2020-08-06 11:17:30 -07:00
dependabot-preview[bot] ea966b495e
Bump Microsoft.CodeAnalysis.CSharp from 3.6.0 to 3.7.0 (#13360) 2020-08-06 10:27: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
Thomas Nieto bedd3bc287
Remove AssemblyInfo property from list views (#13331) 2020-08-05 12:17:09 -07:00
xtqqczze aa43d867af
Switch to MIT license for files copied from Roslyn (#13305) 2020-08-05 10:51:57 -07:00
Dongbo Wang 63cf0c330c
Allow explicitly specified named parameter to supersede the same one from hashtable splatting (#13162)
Allow explicitly specified named parameter to supersede the same one from hashtable splatting.
The work is done in parameter binder, so that parameters can be resolved to cover a parameter's official name, alias name, and unambiguous partial prefix name.

The changes covers covers Hashtable splatting in 3 scenarios:

- Cmdlet or advanced script invocation;
- Simple function invocation;
- ScriptBlock.GetPowerShell(...), where the script block contains command invocation only and uses Hashtable splatting.

Some code refactoring is done to ParameterBinderController to avoid redundant code being duplicated in CmdletParameterBinderController and ScriptParameterBinderController.
2020-08-05 10:59:53 +05:00
Christopher Yeleighton 7ed43d9c16
HelpSystem: Improve the wording of inline comments (#13274) 2020-08-04 15:11:10 -07:00
Joel Sallow (/u/ta11ow) 6aa08f9559
Improve BigInteger casting behaviours (#12629) 2020-08-04 10:45:36 +05:00
Shri Ram K S 9ceee3e52f
Fix Get-Acl -LiteralPath "HKLM:Software\Classes\*" behaviour (#13107)
* Fix #11566 bug

Add pester test for Get-Acl cmdlet

* Replace -pending parameter with -skip

* Fix test failing in Linux and MacOS
2020-07-31 16:44:45 -07:00
xtqqczze 4597b41396
Use is not syntax where appropriate and remove unnecessary parentheses (#13323) 2020-07-31 16:41:59 -07:00
Dongbo Wang 4464d1b414
Add DefaultVisit method to the visitor interface and class (#13258) 2020-07-31 10:16:59 -07:00
Ilya 58b91a89b6
Fix conflicting shorthand switch -s (sta) for pwsh (#13262) 2020-07-31 09:40:42 -07:00
Steve Lee 99b3bfaa34
Change Read-Host -MaskInput to use existing SecureString path, but return as plain text (#13256) 2020-07-30 22:16:37 -07:00
xtqqczze 2eade89f25
Remove unreachable code in CustomShellCommands.cs (#13316) 2020-07-30 17:59:11 -07:00
Dongbo Wang 4b9b0788ed
Revert "Use is null syntax (#13277)" (#13322)
This reverts commit 6c03776d74.
2020-07-30 16:06:38 -07:00
xtqqczze 7beec89f50
Add copyright header to .editorconfig and update files (#13306) 2020-07-30 09:47:21 -07:00
xtqqczze 6c03776d74
Use is null syntax (#13277)
Replace `== null` with `is null`
2020-07-30 18:04:03 +05:00
Dave Goldman 49e432db7a
Fixing typo in Out-File.cs and Out-Printer.cs (#13298) 2020-07-29 11:14:16 -07:00
Dongbo Wang 74ddc3e8a1
Remove ComEnumerator as COM objects using IEnumerator is now supported in dotnet 5.0 (#13259) 2020-07-29 22:12:00 +05:00
Aditya Patwardhan f91e78ad69
Add default help content to the assets folder (#13257)
* Add default help content to the assets folder
* Reformatted and removed TechNet reference
2020-07-26 11:53:56 -07:00
Dongbo Wang cfb1952fd2
Use temp personal path at Runspace startup when env 'HOME' not defined (#13239) 2020-07-23 10:24:42 -07:00
xtqqczze 6ca0024db9
Fix SA1026CodeMustNotContainSpaceAfterNewKeywordInImplicitlyTypedArrayAllocation (#13249)
See https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1026.md
2020-07-23 22:19:15 +05:00
Dongbo Wang f6f966b3dc
Fix Invoke-Command to detect recursive call of the same history entry (#13197) 2020-07-23 09:11:25 -07:00
Shri Ram K S a6bd47f031
Add password confirmation in Get-Credential (#12782)
* Add parameter -ReEnterPassword to prompt user to re-enter the password for confirmation

* Add new public overload function PromptForCredential
2020-07-22 19:13:42 +05:00
github-actions[bot] 9c396aa0ea
Update .NET SDK version from 5.0.100-preview.7.20366.2 to 5.0.100-preview.7.20366.15 (#13200)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-07-22 18:53:33 +05:00
Kirk Munro 472943347d
Add -Runspace parameter to all *-PSBreakpoint cmdlets (#10492) 2020-07-21 11:48:54 -07:00
dependabot-preview[bot] fdf5ddd0d5
Bump NJsonSchema from 10.1.23 to 10.1.24 (#13214)
Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.23 to 10.1.24.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-21 08:43:24 +05:00
Ilya 8c22e5f7d0
Change exe '-inputformat' switch prefix '-in' to '-inp' to fix conflict with '-interactive' (#13205) 2020-07-20 12:16:00 -07:00
xtqqczze 2c18386d79
Avoid usage of do statement to create an infinite loop (#13137)
* Autofix RCS1063
2020-07-20 09:23:14 +05:00
github-actions[bot] 1ed554dde4
Update .NET SDK version from 5.0.100-preview.7.20364.3 to 5.0.100-preview.7.20366.2 (#13192) 2020-07-16 12:12:40 -07:00
Dongbo Wang f90712a317
Handle WSL filesystem path when analyze security zone of a file (#13120) 2020-07-13 13:05:01 -07:00
xtqqczze 8901d2a509
Cleanup: use int instead of uint in places where it's more appropriate (#13141) 2020-07-13 07:10:57 -07:00
PRASOON KARUNAN V a079c63af5
Make other switches mandatory in Split-Path (#13150) 2020-07-13 10:48:45 +05:00
xtqqczze e41a28c2bd
Cleanup: Use int instead of long to avoid Interlocked.Read (#13069) 2020-07-10 11:43:41 -07:00
Ilya 5ad8a5916f
Add support for some .NET intrinsic type converters (#12580) 2020-07-08 14:32:58 -07:00
github-actions[bot] 7da0742cb6
Update .NET SDK version from 5.0.100-preview.6.20318.15 to 5.0.100-preview.7.20356.2 (#13125) 2020-07-07 12:10:11 -07:00
Robert Holt d3addeb3da
Fix Move-Item to support cross-mount moves on Unix (#13044) 2020-07-06 16:39:08 -07:00
xtqqczze 9aba45f18c
Use null check with pattern-matching instead of object.ReferenceEquals (#13065) 2020-07-06 21:51:24 +05:00
Christopher Yeleighton babf02768b
Fix error message from new symbolic link missing target (#13085) 2020-07-03 12:54:26 +05:00
Aditya Patwardhan 808bf22d2f
Ensure assemblies listed FileList are not loaded (#12968)
Co-authored-by: Aditya Patwardhan <Aditya Patwardhan>
2020-06-30 10:16:13 -07:00
dependabot-preview[bot] 1de5e59e03
Bump NJsonSchema from 10.1.22 to 10.1.23 (#13032)
Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.22 to 10.1.23.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-26 08:40:56 +05:00
xtqqczze bd90f1921f
Code performance fixes (#12956)
* RCS1080: Use 'Count/Length' property instead of 'Any' method

* RCS1077: Optimize LINQ method call

* RCS1235: Optimize method call
2020-06-25 11:30:40 +05:00
dependabot-preview[bot] bf3b48db13
Bump NJsonSchema from 10.1.21 to 10.1.22 (#13022)
Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.21 to 10.1.22.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-25 11:27:39 +05:00
Aditya Patwardhan 8030889b7b
Update .NET SDK version from 5.0.100-preview.5.20279.10 to 5.0.100-preview.6.20318.15 (#13018) 2020-06-23 17:30:31 -07:00
Aditya Patwardhan 0d75cfdc2d
Revert "Update .NET SDK version from 5.0.100-preview.5.20279.10 to 5.0.100-preview.6.20319.2 (#12992)" (#13017)
This reverts commit ce8dc1e30c.
2020-06-23 11:52:20 -07:00
Joel Sallow (/u/ta11ow) 02af121ca2
Fix issue in Select-Object where Hashtable members (e.g., Keys) cannot be used with -Property or -ExpandProperty (#11097) 2020-06-19 15:46:54 -07:00
github-actions[bot] ce8dc1e30c
Update .NET SDK version from 5.0.100-preview.5.20279.10 to 5.0.100-preview.6.20319.2 (#12992) 2020-06-19 11:28:09 -07:00
xtqqczze eb9acbc952
Replace SortedList with Generic.SortedList<TKey,TValue> (#12954) 2020-06-19 14:50:31 +05:00
xtqqczze a15e5090e2
Use HashSet instead of Hashtable with null values (#12958) 2020-06-19 08:31:18 +05:00
Steve Lee 2f1d40c4ec
Fix conflicting shorthand switch -w for pwsh (#12945) 2020-06-16 18:36:01 -07:00
Christopher Yeleighton 04b121471a
Make the switch parameter -Qualifier not positional for Split-Path (#12960) 2020-06-16 10:28:41 -07:00
Ilya 409bd318f1
Rename the CimCmdlet resource file (#12955) 2020-06-15 11:00:02 -07:00
dependabot-preview[bot] ed4cd20d80
Bump PSReadLine from 2.0.1 to 2.0.2 (#12909)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Dongbo Wang <dongbow@microsoft.com>
2020-06-12 13:07:41 -07:00
dependabot-preview[bot] f4b8ae5e04
Bump NJsonSchema from 10.1.18 to 10.1.21 (#12944) 2020-06-12 08:18:55 -07:00
Steve Lee ec20043a91
Remove use of Test-Path in ConciseView (#12778) 2020-06-11 16:07:18 +05:00
xtqqczze 58c371ca31
Fix RCS1114: Remove redundant delegate creation (#12917) 2020-06-11 14:01:01 +05:00
xtqqczze 0d5d017f0f
Code redundancy fixes (#12916)
* Autofix `RCS1036: Remove redundant empty line`

* Autofix `RCS1037: Remove trailing white-space`

* Autofix `RCS1033: Remove redundant boolean literal`

* Autofix: `RCS1038: Remove empty statement`

* Autofix `RCS1041: Remove empty initializer`

* Autofix `RCS1097: Remove redundant 'ToString' call

* Autofix: `RCS1420: Operator is unnecessary`
2020-06-11 11:25:35 +05:00
Bryan Berns edf7cc0ead
Resolve the working directory as literal path for Start-Process when it's not specified (#11946) 2020-06-09 10:27:53 -07:00
Carl Morris 2ea18ee6c9
Flag default switch statement condition clause as keyword (#10487) 2020-06-09 10:22:37 -07:00
beatcracker c22ccbebd2
Add parameter SchemaFile to Test-Json cmdlet (#11934) 2020-06-02 13:51:57 -07:00
Aditya Patwardhan 5a42f453c6
Update the PowerShell modules to use the new Help URI (#12686) 2020-06-02 11:46:24 -07:00
Ilya 73e8427586
Bring back Certificate provider parameters (#10622) 2020-06-02 11:44:16 -07:00
xtqqczze c233b30a6a
Reorder modifiers according to preferred order (#12864)
# PR Summary

Reformat using `csharp_preferred_modifier_order`.

## PR Context

Split change from #11773

## 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)
- [x] [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-06-02 16:49:25 +00:00
xtqqczze 8f7d308eaa
Expand numberOfPowershellRefAssemblies list capacity (#12840)
# PR Summary

* Increase the list capacity because .NET v5.0.100-preview.5.20278.13 has an extra assembly
* Remove assert added in #12520

## PR Context

HEAD of master has been broken since 99da109 (#12772), when .NET was updated to 5.0.100-preview.5.20278.13

https://github.com/PowerShell/PowerShell/issues/12815#issuecomment-636132717

## 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)
- [x] [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-06-02 03:57:56 +00:00
Ilya 3de9069ca7
Fix New-Item to create symbolic link to relative path target (#12797) 2020-06-01 13:12:27 -07:00
xtqqczze e93381e73e
Add readonly modifier to internal static members (#11777)
# PR Summary

* Add readonly modifier to internal static members.

## PR Context

## 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)
- [x] [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-31 05:10:22 +00:00
xtqqczze 4e98011833
cleanup: Use coalesce expression (#12829) 2020-05-31 10:01:08 +05:00
xtqqczze 0d5b7f5e6f
Add missing assessibility modifiers (#12820)
# PR Summary

Automated fix of [RCS1018](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1018.md)

## PR Context

## 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)
- [x] [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-31 04:46:24 +00:00
Ilya c7455fd4d8
Add CommandLine property to Process (#12288) 2020-05-29 11:33:49 -07:00
github-actions[bot] 99da109312
Update .NET SDK version from 5.0.100-preview.5.20272.6 to 5.0.100-preview.5.20278.13 (#12772) 2020-05-29 09:36:12 -07:00
xtqqczze 7b6e84d517
Use t_ naming convention for ThreadStatic members (#12826)
# PR Summary

## PR Context

Violations of naming convention were found during #12820

## 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)
- [x] [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-29 12:44:38 +00:00
xtqqczze 05cab7fa5a
Formatting: Add empty line between declarations (#12824)
# PR Summary

Automated fixes:
* RCS0013: Add empty line between single-line declarations of different kind
* RCS010: Add empty line between declarations

## PR Context


## 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)
- [x] [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-29 04:56:33 +00:00
Ilya c602f8272e
Remove extra line before formatting group (#12163) 2020-05-28 13:19:56 -07:00
Sotiris Nanopoulos d26e8c0819
Adds Mask Input Parameter to Read-Host (#10908)
Co-authored-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
2020-05-28 11:08:23 -07:00
Dan Thompson 0137920d89
Make module formatting not generate error with strict mode (#11943) 2020-05-27 15:43:01 -07:00
krishnayalavarthi 281c471e7b
Adding more ETW logs to wsman plugin (#12798) 2020-05-27 13:16:08 -07:00
dependabot-preview[bot] e7325f29cd
Bump NJsonSchema from 10.1.17 to 10.1.18 (#12812)
Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.17 to 10.1.18.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-27 16:12:11 +05:00
xtqqczze 2ea7010dfe
Clarify defaultRefAssemblies list capacity in AddType.cs (#12520)
# PR Summary

* Clarify calculation of `defaultRefAssemblies` initial list capacity.
* Assert if list capacity is increased as a result of a resize.

## PR Context

InitDefaultRefAssemblies may initialize a list too small to hold the reference assemblies distributed with netcoreapp5.0, which may result in an expensive reallocation of the internal array.

## 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)
- [x] [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-27 07:15:29 +00:00
github-actions[bot] 12e0adc57a
Update .NET SDK version from 5.0.100-preview.5.20269.29 to 5.0.100-preview.5.20272.6 (#12759)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
2020-05-23 13:12:09 +00:00
PRASOON KARUNAN V ac40e020aa
Fixing "Double "period" (..) in message for System.InvalidOperationException" (#12758)
<!-- Anything that looks like this is a comment and can't be seen after the Pull Request is created. -->

# PR Summary

Fix for issue: Double "period" (..) in message for System.InvalidOperationException

## 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)
- [x] [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)
        - [x] Issue filed: #12497 
- **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**
    - [ ] 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-23 10:43:43 +00:00
Thomas Larsen 62bb436e71
Change CimCmdlets to use AliasAttribute (#12617) 2020-05-22 12:56:47 -07:00
dependabot-preview[bot] 122bd752fa
Bump NJsonSchema from 10.1.16 to 10.1.17 (#12761) 2020-05-22 10:34:11 -07:00
xtqqczze e132e8b1c1
Rethrow to preserve stack details for better maintainability (#12723) 2020-05-22 10:33:36 -07:00
James Truher [MSFT] 05e682aed1
Update to dotnet SDK 5.0.0-preview.5.20268.9 (#12740)
<!-- Anything that looks like this is a comment and can't be seen after the Pull Request is created. -->

# PR Summary

Update to dotnet SDK 5.0.0-preview.5.20268.9

## PR Context

<!-- Provide a little reasoning as to why this Pull Request helps and why you have opened it. -->

## 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)
- [x] [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**
    - [ ] N/A or can only be tested interactively
    - **OR**
    - [x] [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-21 20:45:57 +00:00
Staffan Gustafsson f8a588c955
Nullable annotations for CommandSearcher (#12733)
<!-- Anything that looks like this is a comment and can't be seen after the Pull Request is created. -->

# PR Summary

Nullable annotations for CommandSearcher

## PR Context

<!-- Provide a little reasoning as to why this Pull Request helps and why you have opened it. -->

## 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)
- [x] [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)**
    - [ ] 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-21 07:25:16 +00:00
Ilya 16c1a369b3
Make -OutFile param in web cmdlets to work like -LiteralPath (#11701) 2020-05-20 15:17:02 -07:00
Steve Lee 15c2245af9
Restrict loading of amsi.dll from system32 folder (#12730)
<!-- Anything that looks like this is a comment and can't be seen after the Pull Request is created. -->

# PR Summary

Restrict search path for `amsi.dll` and `wldp.dll` to just System32 on Windows

## 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)
- [x] [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 20:43:58 +00:00
xtqqczze 36951e05c9
Redundancy: Remove 'partial' modifier from type with a single part (#12725)
# PR Summary

Fix RCS1043

## PR Context

https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1043.md

## 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)
- [x] [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 15:01:58 +00: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
Staffan Gustafsson 9fe96f0d8e
IDictionary -> IDictionary<string, FunctionInfo> for FunctionTable (#12658)
<!-- Anything that looks like this is a comment and can't be seen after the Pull Request is created. -->

# PR Summary

Typed return value for SessionStateInternal.GetFunctionTable.
IDictionary<string, FunctionInfo> instead of IDictionary.

## PR Context

Removes unnecessary casts, and helps with later nullablility changes.

## PR Checklist

- [ ] [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**
    - [ ] N/A or can only be tested interactively
    - **OR**
    - [x] [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 05:36:06 +00:00
dependabot-preview[bot] 5cb7847969
Bump Microsoft.CodeAnalysis.CSharp from 3.5.0 to 3.6.0 (#12731) 2020-05-19 14:32:04 -07:00
xtqqczze 9212aac0fa
Use nameof operator (#12716)
# PR Summary

Using *Roslynator Command Line Tool version 0.1.0.4*

* Fix RCS1015:
  * `"argument"` → `nameof(argument)`
  * `enum.ToString()` → `nameof(enum)`

[RCS1015.log](https://github.com/PowerShell/PowerShell/files/4646102/RCS1015.log)


## PR Context

<!-- Provide a little reasoning as to why this Pull Request helps and why you have opened it. -->

## 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)
- [x] [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-19 18:57:52 +00:00
Sergey Vasin 79a483be34
Fix comments in Mshexpression.cs (#12711)
# PR Summary

Fix comments in Mshexpression.cs

## PR Context

Fix summary comments for ResolveNames methods in Mshexpression.cs.

## 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)
- [x] [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-19 14:49:18 +00:00
Staffan Gustafsson 240a8f7f1b
NRE in CommandSearcher.GetNextCmdlet (#12659)
<!-- Anything that looks like this is a comment and can't be seen after the Pull Request is created. -->

# PR Summary

Fixes a NullReferenceException when searching for malformed cmdlet names

## PR Context

In GetNextCmdlet, there is a check
```csharp
if (!useAbbreviationExpansion && PSSnapinQualifiedCommandName == null)
{
    return null;
}
```
i.e. the null check is only done if useAbbreviationExpansion is false.

Later on we reference PSSnapinQualifiedCommandName in anyway and get an NRE.

## 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)
- [x] [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-19 11:47:07 +00:00
xtqqczze 056b9d7ca3
Formatting: remove duplicate semicolons (#12666) 2020-05-17 15:07:06 -07:00
Robert Holt 3dfd95a09f
Ensure null-coalescing LHS is evaluated only once (#12667) 2020-05-16 21:36:15 +05:00
dependabot-preview[bot] 270eabc6c4
Bump NJsonSchema from 10.1.15 to 10.1.16 (#12685)
Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.15 to 10.1.16.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-16 21:35:16 +05:00
xtqqczze fde00de77f
Update docs.microsoft.com links (#12653)
# PR Summary

* remove explicit en-us from links
* remove view parameter


## PR Context

follow-up #7013

## 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)
- [x] [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)**
    - [ ] 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-15 03:29:43 +00:00
Mathias R. Jessen 3c07aad4bc
Fix path handling bug in PSTask (#12554) 2020-05-14 10:24:28 -07:00
Joel Sallow (/u/ta11ow) 42248a072f
🐛 UnixComputer - null tolerance for tests (#12651) 2020-05-14 13:04:00 +05:00
Dongbo Wang 935f84ee1d
Update build to use the new .NET SDK 5.0.100-preview.4.20258.7 (#12637) 2020-05-13 08:17:37 -07:00
Joel Sallow (/u/ta11ow) 7bc2617fe3
Fix string parameter binding for BigInteger numeric literals (#11634) 2020-05-12 16:31:37 -07:00
Staffan Gustafsson 013839cee1
ParameterBinderBase: Fixing incorrect index in format string (#12630) 2020-05-12 11:31:58 -07:00
Tyler James Leonhardt 1bf5cc9317
Copy the CommandInfo property in Command.Clone() (#12301) 2020-05-11 13:17:43 -07:00
Staffan Gustafsson b003b56e7b
Annotate Assert methods for better code analysis (#12618) 2020-05-11 11:57:31 -07:00
dependabot-preview[bot] 440e02e367
Bump NJsonSchema from 10.1.14 to 10.1.15 (#12608)
Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.14 to 10.1.15.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-09 22:06:21 +05: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
dependabot-preview[bot] 71d8876e60
Bump NJsonSchema from 10.1.13 to 10.1.14 (#12598)
Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.13 to 10.1.14.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-07 15:54:59 +05:00
dependabot-preview[bot] 2c0f138a96
Bump NJsonSchema from 10.1.12 to 10.1.13 (#12583)
Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.12 to 10.1.13.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-06 08:54:09 +05:00
Aditya Patwardhan 633e52f345
Update .NET SDK to 5.0.100-preview.4.20229.10 (#12538) 2020-05-04 18:17:52 -07:00
David Seibel 6d1d62f2f8
Compare-Object Apply -IncludeEqual when -ExcludeDifferent is specified (#12317) 2020-04-30 13:23:55 -07:00
Joshua Cotton c19a417321
Allow / in relative paths for using module (#7424) (#12492) 2020-04-30 11:20:53 -07:00
HumanEquivalentUnit 9e3b34035f
Change Get-FileHash to close file handles before writing output (#12474) 2020-04-30 20:54:20 +05:00
Aditya Patwardhan cc0d20aa08
Bump .NET to 5.0.0-preview.4 (#12507) 2020-04-28 14:18:16 -07:00
dependabot-preview[bot] 7c1fa6c799
Bump Microsoft.ApplicationInsights from 2.13.1 to 2.14.0 (#12479) 2020-04-28 13:18:31 -07:00
dependabot-preview[bot] ee1934b1ce
Bump PackageManagement from 1.4.6 to 1.4.7 in /src/Modules (#12506)
* Bump PackageManagement from 1.4.6 to 1.4.7 in /src/Modules

Bumps PackageManagement from 1.4.6 to 1.4.7.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Update files.wxs

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
2020-04-28 22:59:16 +05:00
Jack Casey 767899d47b
Fix inconsistent exception message in -replace operator (#12388) 2020-04-28 10:45:10 -07:00
Ilya 86b6a9d5ca
Set correct PSProvider full name (#11813) 2020-04-27 16:24:42 -07:00
Steve Lee 23b1dd46ae
Support passing PSPath to native commands (#12386) 2020-04-27 14:14:57 -07:00
Ilya 1a7692fd1a
Use new value for TargetFramework as net5.0 instead of netcoreapp5.0 (#12486) 2020-04-27 08:40:09 -07:00
Joel Sallow (/u/ta11ow) ba53621894
Allow shorter signed hex literals with appropriate type suffixes (#11844) 2020-04-20 16:51:40 -07:00
dependabot-preview[bot] c41c39be2a
Bump System.IO.Packaging (#12365) 2020-04-19 21:39:21 -07:00
dependabot-preview[bot] 022c14917f
Bump Markdig.Signed from 0.18.3 to 0.20.0 (#12379)
Bumps [Markdig.Signed](https://github.com/lunet-io/markdig) from 0.18.3 to 0.20.0.
- [Release notes](https://github.com/lunet-io/markdig/releases)
- [Changelog](https://github.com/lunet-io/markdig/blob/master/changelog.md)
- [Commits](https://github.com/lunet-io/markdig/compare/0.18.3...0.20.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-19 11:00:38 +05:00
Ilya 264bcb3fda
Update UseNewEnvironment parameter behavior of Start-Process cmdlet on Windows (#10830) 2020-04-17 17:19:13 -07:00
Aditya Patwardhan 6d44fa9977
Bump to .NET 5 Preview 3 pre-release (#12353) 2020-04-17 14:22:23 -07:00
dependabot-preview[bot] 5f210c7eeb
Bump PowerShellGet from 2.2.3 to 2.2.4 in /src/Modules (#12342)
Bumps [PowerShellGet](https://github.com/PowerShell/PowerShellGet) from 2.2.3 to 2.2.4.
- [Release notes](https://github.com/PowerShell/PowerShellGet/releases)
- [Commits](https://github.com/PowerShell/PowerShellGet/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-17 08:05:52 +05:00
Andrew 0c695376b7
Fix WinCompat module loading to treat Core edition modules higher priority (#12269) 2020-04-16 16:57:55 -07:00
Eugene Samoylov 07620b4b79
Add -Shuffle switch to Get-Random command (#11093) 2020-04-15 10:23:25 -07:00
Reece Dunham 8b3937ecfe
CodeFactor cleanup (#12251)
* Code cleanup

Signed-off-by: Reece Dunham <me@rdil.rocks>

* whoops

* Update src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs

Co-Authored-By: Travis Plunk <travis.plunk@microsoft.com>

Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
2020-04-14 14:34:53 -07:00
Andrew 14487bf85d
Make GetWindowsPowerShellModulePath compatible with multiple PS installations (#12280)
Add additional check for each component of PSModulePath (that is set for WinPS process) - if it is has pwsh.exe in the parent directory, then it is considered another PS Core installation and this location is also filtered out.
2020-04-14 11:08:01 +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
Chris Gardner 8869e7a4cd
Specifying an alias and -Syntax to Get-Command returns the aliased commands syntax (#10784)
@ChrisLGardner Thank you for your contribution and your patience.
2020-04-13 11:01:08 -07:00
Ilya b1e998046e
Fix NRE in csv commands (#12281) 2020-04-08 16:28:54 -07:00
Christoph Bergmeister [MVP] 622eb4cf02
Upgrade to .NET 5 Preview 2 (#12250) 2020-04-07 17:39:51 -07:00
Michael Klement 5f28df120a
In local invocations do not require -PowerShellVersion 5.1 for Get-FormatData in order to see all format data. (#11270) 2020-04-07 17:37:13 -07:00
Bryan Berns 5f89a10f5b
Added Support For Big Endian UTF-32 (#11947) 2020-04-07 14:33:15 -07:00
Paul Higinbotham 7837a536eb
Fix possible race that leaks PowerShell object dispose in ForEach-Object -Parallel (#12227) 2020-04-07 14:31:04 -07:00
Jack Casey 46071b7ff9
Add -FromUnixTime to Get-Date to allow Unix time input (#12179) 2020-04-07 13:25:03 -07:00
Keith Hill 8d711542e0
Change progress fg & bg colors to provide better contrast (#11455) 2020-04-03 09:13:41 +05:00
dependabot-preview[bot] 6b5d6a0075
Bump PSReadLine from 2.0.0 to 2.0.1 (#12243) 2020-04-01 16:22:37 -07:00
dependabot-preview[bot] 41fef6c4f7
Bump NJsonSchema from 10.1.11 to 10.1.12 (#12230)
Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.11 to 10.1.12.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-01 12:08:55 -07:00
Paul Higinbotham a4c996d425
Fix foreach parallel when current drive is not available (#12197) 2020-03-31 20:33:06 +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
Dongbo Wang e741dc58dd
Discover assemblies loaded by 'Assembly.Load(byte[])' and 'Assembly.LoadFile' (#12203)
* Fix regression: pwsh should discover assemblies loaded by 'Assembly.Load(byte[])' and 'Assembly.LoadFile'
2020-03-28 20:25:59 +05:00
Joel Sallow (/u/ta11ow) dfe9955346
Don't write DNS resolution errors on Test-Connection -Quiet (#12204) 2020-03-28 15:50:32 +05:00
Dongbo Wang 1ec7c826f0
Use dedicated threads to read the redirected output and error streams from the child process for out-of-proc jobs (#11713) 2020-03-28 15:44:23 +05:00
Next Turn 175efca71f
Fix Service.cs to not modify collection while enumerating it (#11851) 2020-03-26 11:17:58 -07:00
Paul Higinbotham 668d72c4af
Clean up the IPC named pipe on PowerShell exit (#12187) 2020-03-26 09:47:33 -07:00
Shayde Nofziger 238cb5c8dc
Fix erroneous comment in tokenizer.cs (#12206)
The BigInteger NumberSuffixFlags enum is 'N', not 'I'. Fix the comment to indicate it as such.
2020-03-26 13:18:33 +05:00
Aditya Patwardhan 7193800bc2
Allow case insensitive paths for determining PSModulePath (#12192)
* Allow case insensitive comparison of paths for determining PSModulePath

* Address codefactor issue
2020-03-25 12:11:06 -07:00
Steve Lee f23be437af
Fix terms checker issues (#12189) 2020-03-24 11:38:45 -07:00
Steve Lee b7cb335f03
Update copyright notice to latest guidance (#12190) 2020-03-24 11:08:37 -07:00
Joel Sallow (/u/ta11ow) f8fb77052f
Fix <img /> detection regex in web cmdlets (#12099) 2020-03-24 10:51:55 -07:00
Aditya Patwardhan 3c81de6d26
Add PowerShell version 7.0 to compatible version list (#12184) 2020-03-24 10:49:54 -07:00
Kevin Locke 68442a33e5
Add documentation for WebResponseObject and BasicHtmlWebResponseObject properties (#11876) 2020-03-23 15:13:47 -07:00
Paul Higinbotham cce214e884
Implement ForEach-Object -Parallel runspace reuse (#12122)
* Implement foreach parallel runspace reuse

* Change runspace dispose

* Refactor runspace reset check

* Fix race condition.

* Fix CodFactor issues

* Implement -UseNewRunspace parameter switch, add tests

* Fix Codacy error
2020-03-23 14:00:43 -07:00
dependabot-preview[bot] 78d7a90bdd
Bump NJsonSchema from 10.1.8 to 10.1.11 (#12166)
Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.8 to 10.1.11.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-20 12:22:46 -07:00
Steve Lee 495dea0783
Move to .NET 5 preview.1 (#12140) 2020-03-19 11:27:13 -07:00
Damir Ainullin 5da06978b1
Set correct priority for ?: operator (#12075) 2020-03-19 08:54:39 +05:00
Dongbo Wang c737f3162c
Fix NullReferenceException when binding common parameters of type 'ActionPreference' (#12124) 2020-03-18 23:18:21 +05:00
Ilya 43e0e1a1c5
Fix default formatting for deserialized MatchInfo (#11728)
MatchInfo class has ToEmphasizedString() member method to color output line.
In remote scenario MatchInfo class is deserialized as Deserialized.Microsoft.PowerShell.Commands.MatchInfo without the method. As result default formating in remote scenario show nothing.

The fix is to directly output Line property.
2020-03-18 18:43:01 +05:00
Ilya 8ebff6a2a4
Use async streams in Invoke-RestMethod (#11095) 2020-03-18 18:40:35 +05:00
Ilya b5d4739b2a
Use span-based overloads (#11884) 2020-03-18 18:38:55 +05:00
dependabot-preview[bot] 320656c8de
Bump Microsoft.CodeAnalysis.CSharp from 3.4.0 to 3.5.0 (#12136)
Bumps [Microsoft.CodeAnalysis.CSharp](https://github.com/dotnet/roslyn) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/dotnet/roslyn/releases)
- [Changelog](https://github.com/dotnet/roslyn/blob/master/docs/Breaking%20API%20Changes.md)
- [Commits](https://github.com/dotnet/roslyn/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-16 13:22:56 -07:00
Bryan Berns 07962a9749
Address UTF-8 Detection In Get-Content -Tail (#11899)
- Addresses a comparison failure that causes UTF-8 detection to fail which in turn causes Get-Content -Tail to resort to forward lookups given encoding type cannot be detected. Possible this misdetection is due to the incoming encoding object as being of type System.Text.UTF8Encoding where as the comparison uses the object Encoding.UTF8 which is derived from System.Text.UTF8Encoding+UTF8EncodingSealed.
- See https://github.com/PowerShell/PowerShell/issues/11830

- Added 'OEM', 'UTF8BOM', and 'UTF8NoBOM' as explicit encodings for existing Get-Content -Tail tests.

* Add Multi-Byte Unicode Tail Character Tests

- Modified -Tail encoding test to use three different test sets: utf-8, utf-16, utf-32.  The test verifies that the content resulting from -Tail is equal to the same string returned from a regular Get-Content using both an explicit and implicit encoding.

* Remove BigEndianUnicode Reference In Comment
2020-03-14 09:57:04 +05:00
Ilya 10e7d1955b
Handle the IOException in Get-FileHash (#11944) 2020-03-13 09:10:19 -07:00
Ilya 2e8ced4856
Use new string.Split() overloads (#11867) 2020-03-13 17:46:05 +05:00
Aleksandar Nikolić 1fa0a00728
Change "PowerShell Core" to "PowerShell" in a resource string (#11928) 2020-03-12 18:04:29 -07:00
Damir Ainullin 5fd89561d0
Remove unreachable DSC code (#12076)
* Remove unreachable code

* Update src/System.Management.Automation/DscSupport/CimDSCParser.cs

Co-Authored-By: Ilya <darpa@yandex.ru>

Co-authored-by: Ilya <darpa@yandex.ru>
2020-03-12 09:53:45 -07:00
Ilya 12bf5f4a0c
Bring back MainWindowTitle in PSHostProcessInfo (#11885)
* Bring back MainWindowTitle in PSHostProcessInfo

* Add test
2020-03-10 09:30:53 -07:00
Andrew 704b0e74ed
Miscellaneous minor updates to WinCompat (#11980)
* Filter PSModulePath when starting PS 5.1. Removing PS-Core-specific paths from PSModulePath of WinCompat process (Windows PS).
* Make implicit WinCompat respect NoClobber and Scope parameters
* Add ErrorAction.Ignore when searching for WinPSCompatSession
2020-03-10 11:31:44 +05:00
dependabot-preview[bot] 86ea202bae
Bump NJsonSchema from 10.1.7 to 10.1.8 (#12088)
Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.7 to 10.1.8.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-09 17:35:58 -07:00
dependabot-preview[bot] ee75eff0e4
Bump Markdig.Signed from 0.18.1 to 0.18.3 (#12078)
Bumps [Markdig.Signed](https://github.com/lunet-io/markdig) from 0.18.1 to 0.18.3.
- [Release notes](https://github.com/lunet-io/markdig/releases)
- [Changelog](https://github.com/lunet-io/markdig/blob/master/changelog.md)
- [Commits](https://github.com/lunet-io/markdig/compare/0.18.1...0.18.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-09 14:59:46 -07:00
dependabot-preview[bot] 74df0f8871
Bump NJsonSchema from 10.1.5 to 10.1.7 (#12050)
Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.5 to 10.1.7.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-07 13:11:40 -08:00
Dongbo Wang 348ca85947
Fix ConciseView to split PositionMessage using [Environment]::NewLine (#12010) 2020-03-04 13:03:08 -08:00
Paul Higinbotham 00b60c44fa
Remove hop restriction for interactive sessions (#11920) 2020-02-28 12:26:08 -08:00
Aditya Patwardhan 4e896983c7
Enable Ctrl+C to work for global tool (#11959) 2020-02-26 15:45:28 -08:00
Steve Lee 2db8516a8c
Fix ConciseView to not show the line information within the error messages (#11952) 2020-02-26 21:07:57 +05:00
dependabot-preview[bot] d87472d368
Bump Microsoft.ApplicationInsights from 2.13.0 to 2.13.1 (#11925) 2020-02-25 17:36:39 -08:00
Dongbo Wang da94afaf5b
Update the map between console color to VT sequences (#11891) 2020-02-20 14:28:38 -08:00
Paul Higinbotham d3ad083833
Fix SSH remoting error on Windows platform (#11907) 2020-02-20 14:10:58 -08:00
Ilya 45bc965af8
Fix NREs in SuspendStoppingPipeline() and RestoreStoppingPipeline() (#11870) 2020-02-20 11:57:00 -08:00
Ilya 59ad53181e
Remove old dead code from FullCLR (#11886) 2020-02-20 11:39:15 -08:00
Steve Lee a09855017f
Generate guid for FormatViewDefinition InstanceId if not provided (#11896) 2020-02-20 19:57:26 +05:00
Steve Lee 34f9b43514
Fix ConciseView where error message is wider than window width and doesn't have whitespace (#11880) 2020-02-20 08:38:28 +05:00
dependabot-preview[bot] d1e1ee70db
Bump Microsoft.ApplicationInsights from 2.12.1 to 2.13.0 (#11894) 2020-02-19 15:33:15 -08:00
dependabot-preview[bot] f854f5499c
Bump System.Data.SqlClient from 4.8.0 to 4.8.1 (#11879) 2020-02-19 12:32:06 -08:00
John Dennis 895d4b3f3e
Allow cross-platform CAPI-compatible remote key exchange (#11185) 2020-02-19 12:28:43 -08:00
Next Turn 8522038cd8
Fix error message (#11862) 2020-02-18 13:07:09 -08:00
dependabot-preview[bot] cec9deb72a
Bump Microsoft.PowerShell.Native from 7.0.0-rc.2 to 7.0.0 (#11839) 2020-02-12 15:59:18 -08:00
Robert Holt 2cfe8a4781
Restore the PowerShellStreamType enum with an ObsoleteAttribute (#11836) 2020-02-12 14:32:07 -08:00
Steve Lee 5edafb6afd
Fix ConciseView to handle case where there isn't a console to obtain the width (#11784) 2020-02-12 11:48:58 +05:00
dependabot-preview[bot] fbb1559fd3
Bump Microsoft.PowerShell.Archive from 1.2.4.0 to 1.2.5 (#11833)
Bumps Microsoft.PowerShell.Archive from 1.2.4.0 to 1.2.5.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-11 14:55:47 -08:00
dependabot-preview[bot] 9ffc693b1e
Bump PSReadLine from 2.0.0-rc2 to 2.0.0 (#11831) 2020-02-11 12:16:03 -08:00
Andrew d2cb3c3636
Sync current directory in WinCompat remote session (#11809) 2020-02-11 11:44:30 -08:00
James Truher [MSFT] 4a0eda7fa9
Handle cases where CustomEvent was not initially sent (#11807) 2020-02-11 11:40:43 -08:00
Dongbo Wang 35c7b7842e
Fix how COM objects are enumerated (#11795) 2020-02-10 13:24:50 -08:00
Dongbo Wang da0695362a
Fix NativeDllHandler to not throw when file is not found (#11787)
<!-- Anything that looks like this is a comment and can't be seen after the Pull Request is created. -->

# PR Summary

Fix `NativeDllHandler` to not throw when file is not found.

Today, the `NativeDllHandler` calls `NativeLibrary.Load(fullName)` even if the file doesn't exist. This is not right, it should return `IntPtr.Zero` to let the runtime try the next resolution approach, if there is one.
Also, this behavior results in the exception message to be `Unable to load DLL 'F:\win-x64\nativedll.dll' or one of its dependencies: The specified module could not be found`, which is confusing because there was never an explicit loading of a dll with that path.
The real exception generated from runtime should be `Unable to load DLL 'nativedll' or one of its dependencies: The specified module could not be found.`

## 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)
- [x] [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-02-07 20:03:16 +00:00
mikeTWC1984 69bf7043c0
Update CmsCommands to use Store vs cert provider (#11643) 2020-02-06 15:38:17 -08:00
Ilya 60387f1ad3
Use Dictionary.TryAdd() where possible (#11767) 2020-02-06 12:49:45 -08:00
Paul Higinbotham a5a97a5939
Fix Invoke-Command missing error on session termination. (#11586) 2020-02-05 15:27:57 -08:00
Andrew 43c88a4ff1
Add WinCompat deny list support using a setting in powershell.… (#11726) 2020-02-04 16:33:26 -08:00
Steve Lee db370dcc79
Enable pwsh to work on Windows systems where mpr.dll and STA is not available (#11748) 2020-02-04 10:52:19 -08:00
Brendan Burns 127fec5eb9
Refactor and implement Restart-Computer for Un*x and macOS (#11319)
Co-authored-by: Ilya <darpa@yandex.ru>
2020-02-03 14:57:17 -08:00
Steve Lee 6c6c9cc41e
Fix help function to check if less is available before usi… (#11737) 2020-02-03 14:38:11 -08:00
Tyler James Leonhardt ac1b83f152
Use Environment.NewLine instead of hard-coded linefeed in ParseError.ToString (#11746) 2020-02-03 14:03:12 -08:00
Ilya 58d53b53fd
Fix FileSystem provider error message (#11741) 2020-02-03 13:13:48 -08:00
xtqqczze c73a599469
Update PSPath in certificate_format_ps1.xml (#11603)
`PSPathPath` is an invalid item property name
2020-02-03 13:03:44 -08:00
xtqqczze 2014ce66c1
Set StrictMode version 3.0 (#11563) 2020-02-03 09:44:10 -08:00
xtqqczze a34d0f3e80
Reformat code according to EditorConfig rules (#11681) 2020-01-31 14:56:22 -08:00
Roman Marusyk 0eaa41b705
Change regex to match relation-types w/o quotes in Link header (#11711) 2020-01-31 14:09:03 -08:00
xtqqczze c4e144b13e
Replace use of throw GetExceptionForHR with ThrowExceptionForHR (#11640)
`System.Runtime.InteropServices.Marshall.GetExceptionForHR` may not return an exception. Instead of `throw GetExceptionForHR` we can use `ThrowExceptionForHR`.

Fix warnings `CS8597:Thrown value may be null.`
2020-01-31 10:13:12 +05:00
xtqqczze 9a7ee0545a
Refactor delegate types to lambda expressions (#11690) 2020-01-30 14:50:14 -08:00
Robert Holt 8ad4997f3c
Fix error message during symlink deletion (#11331) 2020-01-30 14:46:44 -08:00
Robert Holt f0fe356553
Restore SetBreakpoints API (#11622)
* Restore SetBreakpoints API

* Remove default values in API methods

* Fix inheriting APIs

* Correct further comments

* Fix breakpoint API use issues

* Fix breakpoint API tests
2020-01-30 11:27:57 -08:00
Steve Lee 66912b7428
Fix unnecessary trimming of line resulting in incorrect indexi… (#11670) 2020-01-30 11:03:39 -08:00
dependabot-preview[bot] 28dc98e3e7
Bump NJsonSchema from 10.1.4 to 10.1.5 (#11730) 2020-01-30 10:59:58 -08:00
Luca Filipozzi 6c792d7a4c
Do not needlessly pass -l login_name or -p port to ssh (#11518) 2020-01-29 14:40:08 -08:00
Dongbo Wang a4c32bc337
Revert the PRs that made DBNull.Value and NullString.Value treated as $null (#11648) 2020-01-29 14:13:05 -08:00
dependabot-preview[bot] 67bc71325b
Bump Microsoft.ApplicationInsights from 2.12.0 to 2.12.1 (#11708) 2020-01-29 14:10:29 -08:00
dependabot-preview[bot] 7d5c86949f Bump NJsonSchema from 10.1.3 to 10.1.4 (#11620) 2020-01-28 14:04:18 -08:00
dependabot-preview[bot] 585e53c6b6 Bump Markdig.Signed from 0.18.0 to 0.18.1 (#11641) 2020-01-28 12:17:07 -08:00
Ilya eb47c22339
Add custom 'Selected.*' type to PSCustomObject in Select-Object only once (#11548)
Before the fix Select-Object without parameters added custom 'Selected.' type to PSCustomObject even if this type was already present in TypeNames that was a memory leak in the edge case.
The cause of the problem was that Select-Object without parameters did not create a new object but forwarded the original.
The fix is to add custom 'Selected.' type only if object is original and it has not already custom 'Selected.*' type.
2020-01-25 14:10:39 +05:00
Brendan Burns 0b4c43bc11 Add -AsUTC to the Get-Date cmdlet (#11611) 2020-01-24 13:14:00 -08:00
Paul Higinbotham a7a2b12336 Fix for JEA user role in virtual account (#11668) 2020-01-24 09:54:07 -08:00
Joel Sallow (/u/ta11ow) b71d983306 Format-Hex - Fix Grouping Behaviour with Boolean values (#11587)
* Resolve issue with grouping bools & ints

We were not flushing the input buffer immediately when a different
type is encountered.
This caused some odd behaviour when piping in a mix of bools and ints.
Fix is to immediately flush the input buffer when the incoming object is
a different type than anything we have buffered.
2020-01-24 09:52:21 +05:00
Robert Holt caa50510c2 Change name of ClrVersion parameter back (#11623) 2020-01-23 22:21:06 +05:00
Dongbo Wang bf85f3fbe1 Make Test-Connection always use the default synchronization context for sending ping requests (#11517) 2020-01-22 08:19:06 +05:00
Aditya Patwardhan 976f746874 Bump Microsoft.PowerShell.Native from 7.0.0-rc.1 to 7.0.0.rc.2 (#11583) 2020-01-14 14:16:24 -08:00
dependabot-preview[bot] a58037c247 Bump PSReadLine from 2.0.0-rc1 to 2.0.0-rc2 (#11581) 2020-01-14 11:34:42 -08:00
Paal Braathen aada0a80b7 Use ISOWeek for week numbers in Get-Date (#11536) 2020-01-14 10:26:24 -08:00
Steve Lee de2d34b2ad Support expanding ~ in $env:PATH when doing command discovery (#11552) 2020-01-14 10:24:26 -08:00
Ilya aefb82a308
Correct casing for automatic variables (#11568)
* Remove BOM, insert newline at EOF

* Correct case of $MyInvocation special variable

* Correct case of $OFS special variable

* Correct case of $NestedPromptLevel special variable

* Correct case of $Matches special variable

* Correct case of $LASTEXITCODE special variable

* Correct case of $StackTrace special variable

* Correct case of $args special variable

* Correct case of $this special variable

* Correct case of $input special variable

* Correct case of $PSCmdlet special variable

* Correct case of $error special variable

* Correct case of $PSDefaultParameterValues special variable

* Correct case of $PSScriptRoot special variable

* Correct case of $PWD special variable

* Correct case of $null special variable

* Correct case of $true special variable

* Correct case of $false special variable

* Correct case of $PSModuleAutoLoadingPreference special variable

* Correct case of $IsLinux special variable

* Correct case of $IsMacOS special variable

* Correct case of $IsWindows special variable

* Correct case of $IsCoreCLR special variable

* Correct case of $DebugPreference special variable

* Correct case of $VerbosePreference special variable

* Correct case of $InformationPreference special variable

* Correct case of $ExecutionContext special variable

* Correct case of $HOME special variable

* Correct case of $Host special variable

* Correct case of $PID special variable

* Correct case of $PSCulture special variable

* Correct case of $PSHOME special variable

* Correct case of $PSUICulture special variable

* Correct case of $PSVersionTable special variable

* Fix false positives
2020-01-14 21:39:30 +05:00
dependabot-preview[bot] 6a503f4135 Bump NJsonSchema from 10.1.2 to 10.1.3 (#11573) 2020-01-14 08:37:04 -08:00
Ilya 0dfeeb5203
Port GetProcessorArchitecture() (#11046) 2020-01-14 08:41:19 +05:00
Ilya ac069185d6
Fix NRE in ConsiceView (#11435)
Use LanguagePrimitives.TryConvertTo() as last resort to string conversion.
2020-01-14 08:33:16 +05:00
xtqqczze e0d2e2aade Correct case of $PSHOME special variable 2020-01-13 19:35:33 +00:00
xtqqczze 70d9ed4d55 Remove Unicode BOM from text files (#11546) 2020-01-11 12:15:34 +05:00
Ilya 397756a26f Skip null data in output data received handler to fix a NullReferenceException (#11448) 2020-01-09 16:08:09 -08:00
Ilya 57dd869636
Correct startup error messages (#11473) 2020-01-08 11:37:52 +05:00
Sydney Smith b3bd2d4de6 Adding PowerShell Editor Services and PSScriptAnalyzer to tracked modules (#11514) 2020-01-08 01:30:29 +05:00
Ilya e8d472b65b Ignore headers with null values in web cmdlets (#11424) 2020-01-07 12:25:30 -08:00
Thomas Nieto b25e67e607 Remove RequireLicenseAcceptance default value (#11512) 2020-01-07 11:43:58 -08:00
dependabot-preview[bot] 6b96f9aefc Bump Microsoft.PowerShell.Archive from 1.2.3.0 to 1.2.4.0 (#11502) 2020-01-07 11:26:00 -08:00
Tyler James Leonhardt 68b6b1a006 Add ssh parameter sets for JobName (#11444) 2020-01-07 10:21:44 -08:00
spongemike2 1376d310bb Make web cmdlets skip processing the content headers with a null or empty value for backward compatibility (#11421) 2020-01-06 12:11:55 -08:00
Andrew ea48e07c48 Added setting to disable implicit WinPS module loading (#11332) 2020-01-03 10:32:00 -08:00
dependabot-preview[bot] 0667e96200 Bump ThreadJob from 2.0.2 to 2.0.3 in /src/Modules (#11416)
Bumps ThreadJob from 2.0.2 to 2.0.3.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-25 22:20:59 +05:00
dependabot-preview[bot] b7295deaf5 Bump PackageManagement from 1.4.5 to 1.4.6 in /src/Modules (#11427)
Bumps PackageManagement from 1.4.5 to 1.4.6.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-24 08:52:14 +05:00