Download PowerShell-master/test/xUnit/csharp/test_SessionState.cs from MegaBites-AI/Windows-powershell: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/xUnit/csharp/test_SessionState.cs
- Command line
-
hf download hf://datasets/MegaBites-AI/Windows-powershell/PowerShell-master/test/xUnit/csharp/test_SessionState.cs
-
curl -L -o test_SessionState.cs https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/xUnit/csharp/test_SessionState.cs
1.25 kB
| // Copyright (c) Microsoft Corporation. | |
| // Licensed under the MIT License. | |
| 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; | |
| using Xunit; | |
| namespace PSTests.Parallel | |
| { | |
| public class SessionStateTests | |
| { | |
| [] | |
| 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); | |
| } | |
| } | |
| } | |