Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nov 18th, 2021 Community Call #307

Closed
SteveL-MSFT opened this issue Nov 11, 2021 · 21 comments
Closed

Nov 18th, 2021 Community Call #307

SteveL-MSFT opened this issue Nov 11, 2021 · 21 comments

Comments

@SteveL-MSFT
Copy link
Member

SteveL-MSFT commented Nov 11, 2021

Agenda:

  • Welcome Michael (Michael)
  • December Community Call? (Steve)
  • 7.2 GA (Steve)
  • 7.3 roadmap (Steve)
    • PS7 in Windows? (Steve)
  • VSCode-Extension update (Sydney/Andy)
  • PowerShellGallery migration (Amber)
  • How can the community help the team? (Jason)
  • Updateable Help Update (Aditya)
  • PSScriptAnalyzer docs (Sean)
  • PSReadLine 2.2 update (Dongbo)
  • Q&A

Pre-load questions/topics please!

@JustinGrote
Copy link
Contributor

Congrats on 7.2 LTS!

I suppose the obvious next agenda is some of the initial ideas/themes of what the 7.3 roadmap will look like.

@WorrenB
Copy link

WorrenB commented Nov 11, 2021

... the world always has been, the world is, and the world always will be a messy place ...

so what about a possibility to delete wrong/unneeded History entries (e.g. Typos)
from PredictionSource ListView.

image

Highlight/select it and delete it from the history with a PSReadline KeyHandler?
Or maybe something already exists which I don't know?

@daxian-dbw
Copy link
Member

@WorrenB PSReadLine doesn't provide a way to delete history entries, because it adds complexity to how the history entries are synced among different sessions today. So if you want to fix up your history, you will need to manually editing the history file, and make sure to close all powershell instances before doing that to avoid those entries lingering in the cache.

But there are ways for you to reduce typos in your command-line history -- ValidateAndAcceptLine function and the CommandValidationHandler.

You can bind the Enter key with ValidateAndAcceptLine, so when you press Enter it will validate the commands before accepting it as input to PS engine. Here is an example:

Animation

You can also leverage Set-PSReadLineOption -CommandValidationHandler for more sophisticated validating and checks before accepting an input, or even altering the input to fix the typo. For example:

# Auto correct 'git cmt' to 'git commit'
Set-PSReadLineOption -CommandValidationHandler {
    param([CommandAst]$CommandAst)

    switch ($CommandAst.GetCommandName())
    {
        'git' {
            $gitCmd = $CommandAst.CommandElements[1].Extent
            switch ($gitCmd.Text)
            {
                'cmt' {
                    [Microsoft.PowerShell.PSConsoleReadLine]::Replace(
                        $gitCmd.StartOffset, $gitCmd.EndOffset - $gitCmd.StartOffset, 'commit')
                }
            }
        }
    }
}

@bergmeister
Copy link

bergmeister commented Nov 11, 2021

What would help help as well is storing how often a suggestion was accepted so that the first few suggestions can be ordered by 'popularity'. But I understand this of course that the effort for that is quite involving as PowerShell would need another file as a local database for that.

@JustinGrote
Copy link
Contributor

What would help help as well is storing how often a suggestion was accepted so that the first few suggestions can be ordered by 'popularity'. But I understand this of course that the effort for that is quite involving as PowerShell would need another file as a local database for that.

The suggestion provider is extensible so someone can always fork and make one like that :)

@daxian-dbw
Copy link
Member

@michaeltlombardi
Copy link

General topics:

  • steering committees
  • general roadmap for 7.3
  • future for providers (SHiPS is parked?)
  • Gallery improvements/roadmap
  • classes/language feature prioritization
  • how can the community help the team more?

@sba923
Copy link

sba923 commented Nov 12, 2021

Trying to run an EXE which can't start because of a missing DLL on Windows doesn't result in any message on the Error stream. There should be an option to enable that.

@corbob
Copy link
Contributor

corbob commented Nov 12, 2021

Trying to run an EXE which can't start because of a missing DLL on Windows doesn't result in any message on the Error stream. There should be an option to enable that.

@sba923 That sounds more like an issue with the EXE in question than with PowerShell. If the EXE doesn't output to stderr the PowerShell can't pick up anything on the Error stream.

@sba923
Copy link

sba923 commented Nov 12, 2021

The EXE can't display anything 'cos it doesn't even start. The parent process needs to report it cannot start the child, in that case with unhandled exception 0xC0000135 (STATUS_DLL_NOT_FOUND) in that particular case.

@daxian-dbw
Copy link
Member

@sba923 can you check out the value of $LASTEXITCODE after failed to run the EXE from PowerShell? If the value is non-zero, then PowerShell already reported that the child process failed.
Also, If you run that EXE from cmd.exe, will any error message be generated? If not, then it's likely just no error got emitted from the child process, and there is no way for the parent process to know why it failed.

@sba923
Copy link

sba923 commented Nov 13, 2021

Yes, PowerShell does indicate, via $LASTEXITCODE, that the command has failed:

image

But the point is, especially when running interactively, that the failure is "silent." One has to look up the error code to determine what's going on.

CMD, on the other hand, has an exception handler that displays a message box informing the user of the actual cause of the failure:

image

My suggestion is inspired by MKS Korn Shell's set -X option (@BrucePay will remember...):

From set KornShell flags and positional parameters:

image

Of course, that exception is not desirable for scripted / unattended execution, so it should be off by default.

It doesn't have to be a GUI-based one, hence my suggestion to output the explanatory text to the Error stream.

@kilasuit
Copy link

@sba923 can you reference this in a new issue in the main PowerShell repo to ensure that it can be tracked properly

@daxian-dbw
Copy link
Member

CMD, on the other hand, has an exception handler that displays a message box informing the user of the actual cause of the failure:

I don't think the message box is generated by CMD. Is adb a console application (CUI) or a windows application (GUI)?
Please open an issue and the discussion can happen there.

@sba923
Copy link

sba923 commented Nov 13, 2021

adb is a console app. I will open an issue.

@corbob
Copy link
Contributor

corbob commented Nov 13, 2021

@sba923 I can confirm the behaviour appears to be different for each shell that executes adb with a missing dll. Once you've opened an issue could you tag me in it or let me know here and I'll add to it with some of the repro steps I've taken.

@sba923
Copy link

sba923 commented Nov 14, 2021

@ashisharya65
Copy link

ashisharya65 commented Nov 14, 2021

Apologies for asking this stupid question but why connect-AzureAD cmdlet is getting failed on PowerShell 7.2?

Also would like to know if we can us PowerShell 7 with well known Intune app id in order to interact with Intune backend Graph API for running scripts non interactively?

@daxian-dbw
Copy link
Member

@ashisharya65 About the AzureAD module, it's not .NET Core compatible. See details at PowerShell/PowerShell#11932 (comment). As a workaround, import the module with -UseWindowsPowerShell.

@iSazonov
Copy link
Contributor

My personal preferences for roadmap:

  1. FileSystem provider improvements
  2. New remoting subsystem

Also it would be great to see Work Groups with new members and working every day.

@MaximoTrinidad
Copy link

Keep in mind! Some Corporation security policies will block PowerShell 7 implementation due to frequent updates. I take it as my responsibility to help in the adoption in order to be implemented correctly to the people to use it.

Unfortunately, the issue with 7.2.0 missing the correct help docs URL has stopped my progress to have it roll out to the next release, in order to replace the one currently approved (7.1.3).

But WAIT!! I know what I need do in order to get the correct docs for 7.2.. Think outside of the box!!
This Why I love PowerShell!!

Happy Birthday!! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests