Commit graph

29 commits

Author SHA1 Message Date
Kirk Munro 472943347d
Add -Runspace parameter to all *-PSBreakpoint cmdlets (#10492) 2020-07-21 11:48:54 -07:00
Aditya Patwardhan 5a42f453c6
Update the PowerShell modules to use the new Help URI (#12686) 2020-06-02 11:46:24 -07:00
xtqqczze f4382202ae
Use correct casing for cmdlet name and cmdlet parameter name in *.ps1 files (#12584) 2020-05-07 17:00:30 +05:00
Steve Lee b7cb335f03
Update copyright notice to latest guidance (#12190) 2020-03-24 11:08:37 -07:00
xtqqczze 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
Aditya Patwardhan de0866c652 Update HelpInfoUri for all modules in PowerShell 7.0 (#11389) 2019-12-20 10:12:35 +05:00
Steve Lee 384a7ba2d7 Remove the declaration of Get-Error experimental feature from module manifest (#11369) 2019-12-18 09:41:27 -08:00
Steve Lee 7ddfb825e4 Add back Get-Counter cmdlet for Windows (#10933) 2019-11-05 16:48:11 -08:00
Steve Lee b74a26bb91 Added cross-platform Get-Clipboard and Set-Clipboard (#10340)
Co-Authored-By: Ilya <darpa@yandex.ru>



Co-Authored-By: Ilya <darpa@yandex.ru>
2019-11-04 11:28:58 -08:00
Steve Lee 6882ad56fd Add back Out-Printer command (#10906) 2019-11-01 11:27:12 -07:00
Steve Lee ca68d9dbc5 Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow (#10899) 2019-11-01 10:05:32 -07:00
Steve Lee 0b12ea057a Add back Update-List command (#10922) 2019-10-30 11:05:30 -07:00
Steve Lee ca1b6fb4c5 Add back Clear-RecycleBin for Windows (#10909) 2019-10-28 08:18:26 +05:00
Steve Lee d8d32d79c2 Implement Get-Error cmdlet as Experimental Feature (#10727) 2019-10-15 14:32:14 -07:00
Steve Lee 1fa73e360f Add back Get-HotFix cmdlet (#10740) 2019-10-11 22:51:43 +05:00
Kirk Munro cc0fed479a Add APIs for breakpoint management in runspaces and enable attach to process without BreakAll for PSES (#10338) 2019-09-05 11:30:25 -07:00
Steve Lee 82e3480bbf Increase built-with-PowerShell module versions to 7.0.0.0 (#10356) 2019-08-22 15:33:30 -07:00
Steve Lee 3bfca6d0fa Update use of Windows PowerShell to just PowerShell (#9508) 2019-05-03 15:38:06 +05:00
Tyler James Leonhardt 13fd3af810 New New-PSBreakpoint cmdlet & new -Breakpoint parameter for Debug-Runspace (#8923)
This PR does 4 things:

* Adds a new cmdlet `New-PSBreakpoint` which creates new `Breakpoint` objects and writes them to the pipeline
* Adds a `-Breakpoint` parameter to `Debug-Runspace` which will receive `Breakpoint` objects
* Makes the constructors for `*Breakpoint` public for use with the API
* Makes `Debugger.GetBreakpoint(string id)` and `Debugger.GetBreakpoints()` public since `SetBreakpoints` is public

Note: `New-PSBreakpoint` and `Set-PSBreakpoint` (which already exists) are similar... but `Set-PSBreakpoint` also sets the breakpoints in the _current_ runspace. This is not ideal if we want to set breakpoints in a _different runspace than the current one_.

## PR Context  

The "Attach to process" debugging experience in the PowerShell extension for VSCode is _ok_ but it's not great.

The reason it's not great is due to the `BreakAll` feature of PowerShell debugging which, when you run `Debug-Runspace`, will break at the first piece of code that gets run. This is not ideal when you "Attach to process" _and then_ run your code in the other runspace.

Today, the experience drops you in `PSReadLine`'s psm1 if PSRL is available or in the vscode PowerShell helper psm1.

It's unexpected for the user and not ideal.

This PR will allow the extension to pass in the breakpoints that need to be set initially with `BreakAll` turned off for none of this silly behavior.

### Silly behavior example

If you want a repro, try this:

PowerShell instance 1:
```
Enter-PSHostProcess -Id $otherprocesspid
Debug-Runspace 1
```

PowerShell instance 2:
```
./runfoo.ps1
```

Note that you end up NOT `runfoo.ps1`
2019-04-13 19:14:53 -07:00
xtqqczze f0f301bc5e Avoid use of mkdir alias in *.ps1 and *.psm1 (#8582) 2019-01-04 14:31:24 +05:00
Steve Lee 4c24f712eb Expose all cmdlets from PSDiagnostics if logman.exe is available (#8366) 2018-12-05 08:11:59 +05:00
Dongbo Wang a11810bf33
Improve powershell startup time (#8341)
Major changes are as follows:
- Avoid `SecuritySupport.IsProductBinary` and unnecessary AMSI/suspicious code scan at startup time
   - Update `CompiledScriptBlockData.IsProductCode` to avoid unnecessary calls to `IsProductBinary`, which attempts to retrieve catalog signature of the target file.
   - Update `PerformSecurityChecks` to skip AMSI and suspicious code scan for the `.psd1` file that contains a safe `HashtableAst` only.
- Use customized `ReadOnlyBag` instead of `ImmutableHashSet` so that we can avoid loading the `System.Collections.Immutable.dll` completely.
- Replace `SHA1` with `CRC32` when generating module analysis cache file name
   - This remove the loading of `System.Security.Cryptography.Algorithms.dll` at startup
- Move `ConvertFrom-SddlString` to C# to remove the `Utility.psm1` file.
- Crossgen `Microsoft.ApplicationInsights.dll` and enable tiered compilation
   - Even pwsh with crossgen assemblies spends a lot time in jitting at the startup, about `191.6ms` comparing with `24.7ms` for Windows PowerShell.
   - Jitting `Microsoft.ApplicationInsights.dll` takes about `51.6ms`.
   - By crossgen `Microsoft.ApplicationInsights.dll` and enable tiered compilation, the jitting time drops to about `98.9ms`.
2018-12-02 12:52:39 -08:00
Staffan Gustafsson 877b9a9fbf Add cmdlet 'Join-String' for creating text from pipeline input (#7660)
The cmdlet syntax is as follows:
```
Join-String [[-Property] <pspropertyexpression>] [[-Separator] <string>] [-OutputPrefix <string>] [-OutputSuffix <string>] [-UseCulture] [-InputObject <psobject>] [<CommonParameters>]

Join-String [[-Property] <pspropertyexpression>] [[-Separator] <string>] [-OutputPrefix <string>] [-OutputSuffix <string>] [-SingleQuote] [-UseCulture] [-InputObject <psobject>] [<CommonParameters>]

Join-String [[-Property] <pspropertyexpression>] [[-Separator] <string>] [-OutputPrefix <string>] [-OutputSuffix <string>] [-DoubleQuote] [-UseCulture] [-InputObject <psobject>] [<CommonParameters>]

Join-String [[-Property] <pspropertyexpression>] [[-Separator] <string>] [-OutputPrefix <string>] [-OutputSuffix <string>] [-FormatString <string>] [-UseCulture] [-InputObject <psobject>] [<CommonParameters>]
```
2018-11-14 13:52:44 -08:00
Dongbo Wang 63430e91b9
Set 'PowerShellVersion' to 3.0 for built-in modules to make Windows PowerShell work when starting from PSCore (#7365) 2018-07-26 10:10:20 -07:00
Aditya Patwardhan 1cf14bd596 Added Markdown rendering cmdlets
ConvertFrom-Markdown is used for converting a markdown document or string to a MarkdownInfo object.
It can optionally return a HTML or VT100 encoded string in addition to a AST of the markdown document.

Show-Markdown is used to either display the VT100 encoded string on console or redirect the HTML string to the browser.

Set/Get-MarkdownOption cmdlets get be used to view or set markdown rendering options.
2018-07-12 17:13:55 -07:00
Dongbo Wang bda8fd376c Use empty array for Functions/Cmdlets/AliasesToExport to follow the best practice (#7108) 2018-06-19 17:51:28 -07:00
Dongbo Wang 00b0af13d8
Add 'CompatiblePSEditions' to PowerShell Core built-in modules (#7083) 2018-06-15 15:28:58 -07:00
Dongbo Wang 3a5a3e4c6e Remove unneeded "Windows-Full" modules (#7030)
- Remove the Windows-Full folder under src/Modules
- Move content in Windows-Core+Full and Windows-Core to Windows under src/Modules
2018-06-13 09:06:41 +05:00