Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,13 @@ private string ConstructPluginContent(out string srcConfigFilePath, out string d
}
}

string destPath = System.IO.Path.Combine(Utils.DefaultPowerShellAppBase, "SessionConfig",
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?

}

string destPath = System.IO.Path.Combine(destFolder,
shellName + "_" + sessionGuid.ToString() + StringLiterals.PowerShellDISCFileExtension);
if (string.Equals(ProcessorArchitecture, "x86", StringComparison.OrdinalIgnoreCase))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2108,7 +2108,10 @@ Describe "Import-PSSession on Restricted Session" -tags "Feature","RequireAdminO
}
}

It "Verifies that Import-PSSession works on a restricted session" {
# 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


$errorVariable = $null
Import-PSSession -Session $session -AllowClobber -ErrorVariable $errorVariable
Expand Down