FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Get-Help should find help files under $pshome by chunqingchen · Pull Request #3528 · PowerShell/PowerShell · GitHub

Get-Help should find help files under $pshome - #3528

Merged
Mike Richmond (mirichmo) merged 2 commits into
PowerShell:masterfrom
chunqingchen:bugfix3
May 1, 2017
Merged

Get-Help should find help files under $pshome#3528
Mike Richmond (mirichmo) merged 2 commits into
PowerShell:masterfrom
chunqingchen:bugfix3

Conversation

Chunqing Chen (chunqingchen) commented Apr 11, 2017
edited by joeyaiello
Loading

Copy link
Copy Markdown
Contributor

Relevant issue: #2653 #2649

Steps to reproduce

get-help about*
Expected behavior

get-help should be able to find the latest help files under $pshome

Actual behavior

get-help only get the files from C:\Windows\System32\WindowsPowerShell\v1.0

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.15016.1000
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15016.1000
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

If we use SilentlyContinue we do not need to use Test-Path.
We can move New-Item's in BeforeAll:

BeforeAll {
    $helpFile = "about_testCase.help.txt" 
    New-Item -ItemType Directory -Path "$PSHOME\en-US" -ErrorAction SilentlyContinue
    New-Item -ItemType File -Path "$PSHOME\en-US\$helpFile" -Value "about_test" -ErrorAction SilentlyContinue
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Closed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please move it to AfterAll.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Closed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You missed "}".

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please remove the extra line.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Closed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can we verify the exact value instead of $null?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Closed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should this be:

$helpContent | Should Not BeNullOrEmpty

Ilya (iSazonov) Apr 12, 2017
edited
Loading

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please clarify - is "Module" hardcoded for searching help files? And do this folder always exist? Maybe we should New-Item for it too?

Copy link
Copy Markdown
Member

I restarted MacOS because it appeared to have an issue downloading dotnet cli

Copy link
Copy Markdown
Member

Chunqing Chen (@chunqingchen) please verify this also addresses #2649

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should be as follows to avoid output on console.

$null = New-Item -ItemType Directory -Path "$PSHOME\en-US" -ErrorAction SilentlyContinue 

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Same as above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should this be:

$helpContent | Should Not BeNullOrEmpty

Copy link
Copy Markdown
Contributor Author

Aditya Patwardhan (@adityapatwardhan) your comments are resolved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is this test case only meant to run on en-US? If it is, then you should skip it for non-English runs. Otherwise, please use (get-uiculture).Name.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

resolved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This check should probably be $helpContent | Should Match "about_test"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

resolved

Copy link
Copy Markdown
Contributor Author

Francisco Gamino (@Francisco-Gamino) thanks, your comments are resolved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Also, does this tests run on Linux? If it does, then please use Join-Path instead of "$path\value"
E.g.,
$helpContentPath = join-path $PSHOME $culture
if (-not (test-path $helpContentPath))
{
}

Copy link
Copy Markdown
Contributor Author

Francisco Gamino (@Francisco-Gamino) thanks, your comment is resolved !

Copy link
Copy Markdown
Member

Francisco Gamino (@Francisco-Gamino) && Aditya Patwardhan (@adityapatwardhan) Do you guys have any more concerns or is this ready for merge?

Steve Lee (SteveL-MSFT) added this to the 6.0.0-beta1 milestone May 1, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please update this path $modulePath\en-US to $modulePath(get-uiculture).name. Other than that, it looks good. Thanks.

Describe "Validate about_help.txt under culture specific folder works" -Tags @('CI') {
BeforeAll {
$modulePath = "$pshome\Modules\Test"
$null = New-Item -Path $modulePath\en-US -ItemType Directory -Force

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This path should be $modulePath(get-culture).name

Copy link
Copy Markdown
Member

Chunqing Chen (@chunqingchen) Changes approved.

Copy link
Copy Markdown
Contributor Author

Francisco Gamino (@Francisco-Gamino) en-us is replaced with culture
Mike Richmond (@mirichmo) please merge the change.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Successfully merging this pull request may close these issues.

8 participants


Back | FazBrowse Home | New Git URL