GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — Support `Get-PSHostProcessInfo` and `Enter-PSHostProcess` on non-Windows by SteveL-MSFT · Pull Request #8232 · PowerShell/PowerShell Conversation
|
|
Regarding the server named pipe dispose, this is done in WindowsPowerShell via the CLR AppDomain unload event, which is not supported on CORECLR. However, you can use the AppDomain.CurrentDomain.ProcessExit event that we use for AMSI un-initializing. Unfortunately, these CLR events are not reliable, but they are better than nothing. The start time added to the filename is intended to make the named pipe instance unique, to prevent a DOS or man-in-the-middle attack. We will want to keep something like this, even if it means using something shorter. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I love when a PR has more deletions than insertions yet more functionality |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
As for the domain name, do we really need it for the pipe name? Is multiple domain is going to be supported in .NET Core 3.0? I have no problem keeping it for now until we get an accurate answer for the app domain support. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Dongbo Wang (@daxian-dbw) best I can tell, AppDomains are deprecated in .Net Core and not in the roadmap I can see for 3.0. So it may be fine to remove it for non-Windows. We'll have to keep it for Windows so that Windows PowerShell and PowerShell Core interop still works however. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yes, I have proposed dropping the Domain name. If it gets supported again in dotNet Core then we can add it back. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
To retain interoperability between Windows PowerShell and keep the code similar between Windows and non-Windows, I'll shorten the DefaultAppDomainName to 'none' but will keep it in the pipe name. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
010e0a4 to
6cbc498
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We'll have to keep it for Windows so that Windows PowerShell and PowerShell Core interop still works however.
Then we should keep the AppDomain field on all platforms. none is short enough and it's better to keep the same schema.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Steve Lee (@SteveL-MSFT) I forgot about maintaining compatibility with Windows PowerShell. We definitely need to ensure we can still list/parse/connect to those hosts. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ugh, with the changes I've made since, I can't connect to/from Windows PowerShell and PowerShell Core. Debugging. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Looks like DefaultAppDomain is necessary on Windows as there is a check for that string and the starttime needs to stay as filetime integers on Windows to support interop between Windows PowerShell and PowerShell Core. I believe everything else is addressed. Paul Higinbotham (@PaulHigin) can you take another look? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Steve Lee (@SteveL-MSFT) Yeah, for Windows we need to keep the DomainName to be able to connect to WindowsPowerShell host, and that means keeping the default domain name for Windows platform pipe names. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Paul Higinbotham (@PaulHigin) yes, the recent commit has the same DefaultAppDomainName and starttime format on Windows and I verified manually it works from and to Windows PowerShell |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I wonder if we should add a test to ensure WindowsPowerShell is listed by Get-PSHostProcessInfo? WindowsPowerShell is always installed on Windows so it shouldn't be too hard to run powershell.exe and check.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Paul Higinbotham (@PaulHigin) good suggestion. Let me add a test for Windows PowerShell interop. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Steve Lee (@SteveL-MSFT), there are tests about |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Dongbo Wang (@daxian-dbw) it appears to be a problem with redirected input with PSReadLine and only on AppVeyor. We're moving off AppVeyor (eventually), so I think we can ignore this otherwise we'll have to special case this by perhaps removing PSReadLine for this test |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Given Steve Lee (@SteveL-MSFT)'s clarification on the AppVeyor test failure, I'm merging this PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…tforms (PowerShell#8232) There a some differences in support of named pipes for Windows and non-Windows. Named pipes on Unix have a 104 character path limit. On macOS, the `$env:TMPDIR` (on my system) is already 49 characters; corefx adds 12 more. Since AppDomainName isn't really used, changed it from `DefaultAppDomain` to `None` to shorten the name. Need to keep it since Windows PowerShell expects it. Changed `starttime` part of pipe name to 8 hex characters which is to provide uniqueness to the pipe name.
…tforms (PowerShell#8232) There a some differences in support of named pipes for Windows and non-Windows. Named pipes on Unix have a 104 character path limit. On macOS, the `$env:TMPDIR` (on my system) is already 49 characters; corefx adds 12 more. Since AppDomainName isn't really used, changed it from `DefaultAppDomain` to `None` to shorten the name. Need to keep it since Windows PowerShell expects it. Changed `starttime` part of pipe name to 8 hex characters which is to provide uniqueness to the pipe name.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
port Get-PSHostProcessInfo and Enter-PSHostProcess cmdlets to non-Windows
There was an error while loading. Please reload this page.