658960e3f9
Make PowerShell Core reads group policy settings from different registry keys (Windows only) and the configuration files (both Windows and Unix). - On Windows, move to different GPO registry keys. - On both Windows and Unix, read GPO related settings from the configuration file `powershell.config.json`. - On Windows, the policy settings in registry take precedence over the configuration file. - Enable policy controlled logging and transcription on Unix.
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using Xunit;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.ObjectModel;
|
|
using System.Globalization;
|
|
using System.Management.Automation;
|
|
using System.Management.Automation.Host;
|
|
using System.Management.Automation.Internal;
|
|
using System.Management.Automation.Internal.Host;
|
|
using System.Management.Automation.Runspaces;
|
|
using Microsoft.PowerShell;
|
|
|
|
namespace PSTests.Parallel
|
|
{
|
|
public class SessionStateTests
|
|
{
|
|
[SkippableFact]
|
|
public void TestDrives()
|
|
{
|
|
Skip.IfNot(Platform.IsWindows);
|
|
CultureInfo currentCulture = CultureInfo.CurrentCulture;
|
|
PSHost hostInterface = new DefaultHost(currentCulture,currentCulture);
|
|
InitialSessionState iss = InitialSessionState.CreateDefault2();
|
|
AutomationEngine engine = new AutomationEngine(hostInterface, iss);
|
|
ExecutionContext executionContext = new ExecutionContext(engine, hostInterface, iss);
|
|
SessionStateInternal sessionState = new SessionStateInternal(executionContext);
|
|
Collection<PSDriveInfo> drives = sessionState.Drives(null);
|
|
Assert.NotNull(drives);
|
|
}
|
|
}
|
|
}
|