| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…ell PSModulePath by default to encourage testing of using FullCLR modules
| 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.
Typo in Installed.
Sorry, something went wrong.
There was a problem hiding this comment.
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.
| # 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.
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 a problem hiding this comment.
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.
|
Although I intend for this to be temporary, I'll add a test case |
Sorry, something went wrong.
| # 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.
-Force ? When rebuilding without cleaning.
Sorry, something went wrong.
There was a problem hiding this comment.
make sense, will add
Sorry, something went wrong.
|
|
||
| It "Default PowerShell profile appends Windows PowerShell PSModulePath only on Windows" { | ||
|
|
||
| $psmodulepath = & $powershell -c '$env:PSModulePath' |
There was a problem hiding this comment.
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 a problem hiding this comment.
I thought I did, but hit a few more failures. Will fix.
Sorry, something went wrong.
|
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.
|
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.
…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 a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
Jason Shirk (@lzybkr) can you merge so we can get this in for beta.4? |
Sorry, something went wrong.
|
Travis Plunk (@TravisEz13) can you merge this since Jason Shirk (@lzybkr) is currently out of office? |
Sorry, something went wrong.
|
This change doesn't make sense on new Nano Server container. "WARNING: Appended Windows PowerShell PSModulePath" PS C:\> $env:psmodulepath -split ';' PowerShell\Modules c:\program files\powershell\Modules C:\Users\ContainerUser\Documents\WindowsPowerShell\Modules C:\Program Files\WindowsPowerShell\Modules C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ 3 of those 5 paths are unnecessary on new Nano Server. |
Sorry, something went wrong.
|
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.
|
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.
|
Nagy-Egri Máté Ferenc (@MathiasMagnus) edit Microsoft.PowerShell_profile.ps1 in $PSHome and remove the Write-Warning line |
Sorry, something went wrong.
|
Steve Lee (@SteveL-MSFT) Thanks. :) As a sidenote: is it instructive to think that these are 1-to-1 mappings?
|
Sorry, something went wrong.
Sorry, something went wrong.
…#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.
| Back | FazBrowse Home | New Git URL |
Now that we have moved to .Net Std 2.0 compatible CoreClr 2.0 and added capability to search GAC for assemblies, we need to make it easier for users to use Windows PowerShell modules from PSCore6 to get feedback on compatibility.
This change is only for Windows and appends the Windows PowerShell PSModulePath on startup. 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.
Out-Default tests has to be updated to suppress the Warning message by not loading the profile.
Related #4056
Based on the customer data, we can decide a more permanent solution.