Skip to content

Register-PSSessionConfiguration fails if SesionConfig folder doesn't exist #4271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2017

Conversation

SteveL-MSFT
Copy link
Member

Create SessionConfig folder if it doesn't exist for Register-PSSessionConfiguration

PaulHigin
PaulHigin previously approved these changes Jul 17, 2017
Copy link
Contributor

@PaulHigin PaulHigin left a comment

Choose a reason for hiding this comment

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

LGTM

@SteveL-MSFT
Copy link
Member Author

@PaulHigin Windows PowerShell 5.1 needs this change as well before this test will pass, right (since the default remoting endpoint still goes to Windows PowerShell)? If so, I'll change this test to Pending

@PaulHigin
Copy link
Contributor

@SteveL-MSFT I thought that we use a new plugin for PowerShell 6.0. Not sure but I know a new plugin was created for Core. @JamesWTruher can you comment?

Regarding PowerShell 5.1, the SessionConfig folder should always be created via Windows manifest. I feel this change is only needed for the case where the folder is inadvertently deleted (through some previous test) or for PowerShell 6.0 when it is never created.

@SteveL-MSFT
Copy link
Member Author

Sync'd with @PaulHigin off line, this test will still fail because the default endpoint still points to 5.1 which doesn't have the fix to expose -PowerShellVersion yet. Rather than making this test pending, I think it makes sense to have the default remoting to go to 6.0, I'll look into that.

@daxian-dbw
Copy link
Member

Rather than making this test pending, I think it makes sense to have the default remoting to go to 6.0, I'll look into that.

@PaulHigin @SteveL-MSFT Will that be a separate PR? If so, I will merge this one.

@SteveL-MSFT
Copy link
Member Author

@daxian-dbw I'm going to make it part of this PR otherwise the test will still fail

@daxian-dbw daxian-dbw dismissed PaulHigin’s stale review July 17, 2017 18:12

Fix is not completed yet.

@SteveL-MSFT
Copy link
Member Author

I'm going to make this test Pending as it's blocked by #4275

@daxian-dbw
Copy link
Member

@SteveL-MSFT one question before merging the PR: the test in question has been there for a long time, so why did it start to fail recently?

@SteveL-MSFT
Copy link
Member Author

@daxian-dbw that specific test was added recently by @PaulHigin SteveL-MSFT@7fa0dd0

@daxian-dbw daxian-dbw merged commit 44e3775 into PowerShell:master Jul 18, 2017
@SteveL-MSFT SteveL-MSFT deleted the implicit-remoting-test branch July 18, 2017 17:09
@PaulHigin
Copy link
Contributor

It looks like similar implicit remoting tests in Implicit.Remoting.Tests.ps1 are disabled for core and we should do the same for this test. Is there an Issue for this?

string destFolder = System.IO.Path.Combine(Utils.DefaultPowerShellAppBase, "SessionConfig");
if (!Directory.Exists(destFolder))
{
Directory.CreateDirectory(destFolder);
Copy link
Collaborator

@iSazonov iSazonov Jul 18, 2017

Choose a reason for hiding this comment

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

Sorry for being late - what if the user haven't permissions?

Copy link
Member

Choose a reason for hiding this comment

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

Good catch! For example, on Linux, powershell is installed at /opt/microsoft/powershell, and you don't have permission to create a folder unless using sudo.

Copy link
Contributor

Choose a reason for hiding this comment

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

@iSazonov Thanks, we will have to think about how this will work and where configuration information goes for Linux cases, but for now I think letting an "access denied" error propagate is fine since these cmdlets cannot work correctly without access.

Copy link
Contributor

Choose a reason for hiding this comment

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

I should mention that these cmdlets are currently implemented only on Windows platform.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please open a tracking Issue?

# Blocked by https://github.com/PowerShell/PowerShell/issues/4275
# Need a way to created restricted endpoint based on a different endpoint other than microsoft.powershell which points
# to Windows PowerShell 5.1
It "Verifies that Import-PSSession works on a restricted session" -Pending {
Copy link
Contributor

Choose a reason for hiding this comment

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

I just noticed that similar implicit remoting tests are disabled using special checks:

# Skip tests for CoreCLR for now
# Skip tests on ARM
$skipTest = $IsCoreCLR -or $env:PROCESSOR_ARCHITECTURE -eq 'ARM'

if ($skipTest) { return }

We should make this test be the same since remoting really does not work yet with PowerShell 6.0 based endpoints. Or maybe we should mark all tests that aren't supported as "pending" since we no longer support FullCLR.

Copy link
Member Author

Choose a reason for hiding this comment

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

@PaulHigin can you open a separate issue for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Done. Issue #4289

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.

5 participants