Michael Klement
Michael Klement
@zero77: `pwsh.exe` must remain a console-subsystem application to ensure synchronous, standard-streams-connected execution from an existing console window. We therefore need the previously discussed _separate_, GUI-subsystem executable, `pwshw.exe`. If we want...
Thanks for the helpful parameters table, @iSazonov. I think `-NonInteractive` and`-WindowStyle` can be removed too, as they only have meaning in the context of a _console_ window - which the...
> If `pwshw.exe` is for no-console scenario what exe will be for GUI? `pwshw.exe` can do double duty: * For automation (run hidden from a scheduled task, for instance) *...
> Should we keep `-WindowStyle` for them? I don't think that's useful, because there's no telling in advance at what point and through what mechanism a GUI window - if...
It's good to have workarounds and a third-party solution, but to emphasize @alexbuzzbee's last comment: A solution is needed that _comes with PowerShell_. --- As for the workarounds: note that...
Thanks, @alexbuzzbee, I've added your caveat to my previous comment. I think it is actually the VBScript `CreateObject()` / JScript `new ActiveXObject()` call that triggers the alert; seemingly, `mshta.exe` has...
Good to know, @alexbuzzbee. I based my comment on the fact that executing the following (e.g. from `cmd.exe`) yields an `Access is denied error.` and triggers a Windows Defender alert....
@stephen147, hiding a PowerShell invocation _from an existing console window_ is not the problem. What this issue is about is the ability to launch PowerShell _not_ from a console _without...
@stephen147, thank you for suggesting a workaround that _mitigates_ the underlying problem. By saying your solution managed to "get around" the problem, others may be tempted to infer that your...
All great suggestions, @Jaykul. Re making `@()` notation mean a `List[PSObject]`: I think we can take this further and use an efficiently extensible collection type as PowerShell's fundamental collection type,...