Skip to content

Enable WSManCredSSP cmdlets - #4336

Merged
Aditya Patwardhan (adityapatwardhan) merged 5 commits into
PowerShell:masterfrom
SteveL-MSFT:credssp
Aug 10, 2017
Merged

Enable WSManCredSSP cmdlets#4336
Aditya Patwardhan (adityapatwardhan) merged 5 commits into
PowerShell:masterfrom
SteveL-MSFT:credssp

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

Fixed error message using a null resourcemanager
With most recent CoreFx supporting STA, removed special CoreClr code paths
Added test coverage
Removed some dead commented out code that was never used

Part of #4158

Fix #3353

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

AppVeyor failure waiting on #4323

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.

Why were these two checks removed?

@SteveL-MSFT Steve Lee (SteveL-MSFT) Jul 26, 2017

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

line 486 and 890 already does the check

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.

Ca you rename this variable to remove the initial "g"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

can do

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.

Why were these two checks removed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

check happens twice

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.

  1. Does this line work on non-Windows platforms?
  2. Code should not be outside of a Pester block. This should be moved within a BeforeAll
  3. Check out the guidelines on Admin for Windows
  4. Consider using the pattern for skipping tests as well.

@SteveL-MSFT Steve Lee (SteveL-MSFT) Jul 26, 2017

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

  1. will wrap in $IsWindows
  2. will wrap in BeforeAll
  3. this is the opposite of requiring admin, this test requires NOT admin (there isn't a RequireNotAdminOnWindows)
  4. two different test cases here where the first is only applicable when NOT admin, the second one works either way

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.

Why are these tests separated into separate files? We have been grouping tests for each cmdlet into a single file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I suppose I can combine them. I thought to separate them because at least one test case requires non-admin.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just tried it combined and start-pspester only ran the tests as elevated so that one test gets skipped. I'll have to have the non-admin tests as separate.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Actually it appears you have explicitly run start-pspester with -unelevated. I'll have to take care of this myself in the script then.

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.

The same comments apply to this file as well

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is redundant from line 486

@SteveL-MSFT
Steve Lee (SteveL-MSFT) force-pushed the credssp branch 2 times, most recently from 1e9b8af to a06b389 Compare July 26, 2017 16:25
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

CI failure is due to one of the same failures in the nightly run unrelated to this PR. I'll fix that first.

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.

Please check for en-US before comparing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

will fix

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.

Same as above

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

will fix

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.

Same as above.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

will fix

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.

Same as above

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

will fix

@SteveL-MSFT
Steve Lee (SteveL-MSFT) force-pushed the credssp branch 2 times, most recently from 1501d34 to c74be60 Compare August 1, 2017 00:48
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Mike Richmond (@mirichmo) can you complete your review?

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.

As a general rule when using this pattern, a test that is skipped in an environment should not execute any code.

Lines 11 through 15 should not be executed if the test is skipped. Putting them in an else {} would solve this problem.

@adityapatwardhan

Copy link
Copy Markdown
Member

Mike Richmond (@mirichmo) Can you rebase, it should fix the test failures.

Steve Lee (SteveL-MSFT) and others added 4 commits August 8, 2017 09:23
Fixed error message using a null resourcemanager
With most recent CoreFx supporting STA, removed special CoreClr code paths
Added test coverage
Removed some dead commented out code that was never used
merged tests to one file, use runas to have relevant tests run as non-elevated
Get-CredSSP returns text so only run that test if current culture is en-US
@adityapatwardhan

Copy link
Copy Markdown
Member

Tests are failing on Linux.
image

@mirichmo

Copy link
Copy Markdown
Member

All the CredSSP tests are now passing in AppVeyor and Travis.

@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit eea3885 into PowerShell:master Aug 10, 2017
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the credssp branch August 14, 2017 06:25
@ltamaster

Copy link
Copy Markdown

Hi All,
I was looking to use the WSManCredSSP functionalities.
has this PR enabled in a release?
I checked the v6.0.0-beta.6 because it mentions that it was added, but it didn't work for me.

screenshot 2017-11-22 17 16 30

Thanks
Luis

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Luis Toledo (@ltamaster) CredSSP is only supported on Windows

@iSazonov

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT) It seems PowerShell docs haven't "Supported platforms: Windows, Linux, MacOS" in cmdlet's descriptions.
Also we could make the error message more clear: "The term Cmdlet is not supported on the platform or is not recognized ..."

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Ilya (@iSazonov) can you point me to the docs that say it's supported on Linux/macOS? Don't see that line here

I think the error message is technically correct as that cmdlet doesn't exist on non-Windows. It's a generic error message if a cmdlet is not found, so implying it's not supported may cause confusion particularly for typos.

@iSazonov

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT) I agree that we can leave the generic message "as is" if we enhance our docs.

can you point me to the docs that say it's supported on Linux/macOS?

It is just my request to enhance our docs - add new section "Supported platforms".

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
* [Feature]
Fixed error message using a null resourcemanager
With most recent CoreFx supporting STA, removed special CoreClr code paths
Added test coverage
Removed some dead commented out code that was never used

* [Feature]
merged tests to one file, use runas to have relevant tests run as non-elevated

* [Feature]
Get-CredSSP returns text so only run that test if current culture is en-US

* [Feature] Update test to fix code exclusion

* [Feature] Fix Skipping on test cases that already had a Skip value
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.

6 participants