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 — Enable Windows PowerShell PSModulePath by default on Windows by SteveL-MSFT · Pull Request #4132 · PowerShell/PowerShell Conversation
|
| The currently installed .NET Command Line Tools is not the required version. | ||
|
|
||
| Installed version: $dotnetCLIIntalledVersion | ||
| Installed version: $dotnetCLIIntalledVersion |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Typo in Installed.
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.
That wasn't part of this PR, but since I only see 3 hits, I'm leaning towards fixing it here instead of a new PR
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # If a Windows PowerShell module works or not, please provide feedback at https://github.com/PowerShell/PowerShell/issues/4062 | ||
|
|
||
| Write-Warning "Appended Windows PowerShell PSModulePath" | ||
| $env:psmodulepath += ";${env:userprofile}\Documents\WindowsPowerShell\Modules;${env:programfiles}\WindowsPowerShell\Modules;${env:windir}\system32\WindowsPowerShell\v1.0\Modules\" |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This only gets the default, if the Windows PSModulePath is modified by installing Azure cmdlets or SQL, then they won't be available. We would need something like this:
$env:PSModulePath += (";" + (& ${env:windir}\system32\windowspowershell\v1.0\powershell.exe '$env:PSModulePath'))
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.
Calling out to Windows PowerShell can incur a 150-250ms startup penalty. Since this change isn't intended to be the final solution and just helps to get customer feedback, I think we are ok with it not being 100% accurate. Advanced customers can update their PSModulePath as needed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Although I intend for this to be temporary, I'll add a test case |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
232f7f3 to
4f067eb
Compare
4f067eb to
1eb7b51
Compare
| # copy PowerShell host profile if Windows | ||
| if ($IsWindows) | ||
| { | ||
| Copy-Item -Path "$PSScriptRoot/src/powershell-win-core/Microsoft.PowerShell_profile.ps1" -Destination $publishPath |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
-Force ? When rebuilding without cleaning.
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.
make sense, will add
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| It "Default PowerShell profile appends Windows PowerShell PSModulePath only on Windows" { | ||
|
|
||
| $psmodulepath = & $powershell -c '$env:PSModulePath' |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Like in this test case, would other tests now have the warning message and fail? Can you verify by running all tests?
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.
I thought I did, but hit a few more failures. Will fix.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Because this is a temporary change - can we have a temporary test that will fail at some fixed point in the future - even if it's a nightly failure, that would be fine. The point here - if we reach that point where the test starts failing, we need to take action, either implement this correctly (not via a profile script), remove it, or something else. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
1eb7b51 to
85b6401
Compare
|
Jason Shirk (@lzybkr) rather than having a temporary test, I've changed this to not be a 'fix' but related so we'll keep the issue open and will revisit after we get some customer data |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ell into windows-psmodulepath
|
Aditya Patwardhan (@adityapatwardhan) looks like I had some changes staged on a different computer that wasn't committed (Console Tests), can you take a quick look? |
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
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Jason Shirk (@lzybkr) can you merge so we can get this in for beta.4? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Travis Plunk (@TravisEz13) can you merge this since Jason Shirk (@lzybkr) is currently out of office? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This change doesn't make sense on new Nano Server container. "WARNING: Appended Windows PowerShell PSModulePath" 3 of those 5 paths are unnecessary on new Nano Server. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Aleksandar Nikolić (@alexandair) you are correct, NanoServer-Insider doesn't have Windows PowerShell Core 5.1 anymore. Can you add a comment to #4056? The final resolution to this will likely be adding a config setting to the startup json file and checking if full windows. Thanks. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Steve Lee (@SteveL-MSFT) Done. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Is there a way to turn off the warning? It's fairly annoying and I can give feedback without it reminding me on every startup. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Nagy-Egri Máté Ferenc (@MathiasMagnus) edit Microsoft.PowerShell_profile.ps1 in $PSHome and remove the Write-Warning line |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Steve Lee (@SteveL-MSFT) Thanks. :) As a sidenote: is it instructive to think that these are 1-to-1 mappings?
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…#4132) This change is only for Windows and appends the Windows PowerShell PSModulePath on startup via a default profile. Depending on the data/feedback we get, we can decide what to do (opt-in vs opt-out) as we get closer to a release candidate.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.