Team Ai
Datasetpublic

MegaBites-AI/Windows-powershell

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes308downloads
test_SessionState.cs35 linesDownload Raw Back to csharp
1// Copyright (c) Microsoft Corporation.2// Licensed under the MIT License.3 4using System;5using System.Collections;6using System.Collections.ObjectModel;7using System.Globalization;8using System.Management.Automation;9using System.Management.Automation.Host;10using System.Management.Automation.Internal;11using System.Management.Automation.Internal.Host;12using System.Management.Automation.Runspaces;13using Microsoft.PowerShell;14using Xunit;15 16namespace PSTests.Parallel17{18    public class SessionStateTests19    {20        [SkippableFact]21        public void TestDrives()22        {23            Skip.IfNot(Platform.IsWindows);24            CultureInfo currentCulture = CultureInfo.CurrentCulture;25            PSHost hostInterface = new DefaultHost(currentCulture, currentCulture);26            InitialSessionState iss = InitialSessionState.CreateDefault2();27            AutomationEngine engine = new AutomationEngine(hostInterface, iss);28            ExecutionContext executionContext = new ExecutionContext(engine, hostInterface, iss);29            SessionStateInternal sessionState = new SessionStateInternal(executionContext);30            Collection<PSDriveInfo> drives = sessionState.Drives(null);31            Assert.NotNull(drives);32        }33    }34}35